changed mlx_put_transformed_image_to_window to use float position

This commit is contained in:
Daemo
2026-08-12 19:25:09 +02:00
parent 63fe3088bf
commit 42f0d52bfa
4 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -136,7 +136,7 @@ namespace mlx
p_scene->BringToDrawLayer(text.Get(), m_draw_layer);
}
void GraphicsSupport::TexturePut(NonOwningPtr<Texture> texture, int x, int y, float scale_x, float scale_y, float angle)
void GraphicsSupport::TexturePut(NonOwningPtr<Texture> texture, float x, float y, float scale_x, float scale_y, float angle)
{
MLX_PROFILE_FUNCTION();
NonOwningPtr<Sprite> sprite = p_scene->GetSpriteFromTexturePositionScaleRotation(texture, Vec2f{ static_cast<float>(x), static_cast<float>(y) }, scale_x, scale_y, angle);
@@ -146,14 +146,14 @@ namespace mlx
{
m_draw_layer++;
m_pixelput_called = false;
}
}
Sprite& new_sprite = p_scene->CreateSprite(texture);
new_sprite.SetCenter(Vec2f{ texture->GetWidth() * 0.5f, texture->GetHeight() * 0.5f });
new_sprite.SetPosition(Vec2f{ static_cast<float>(x), static_cast<float>(y) });
new_sprite.SetScale(Vec2f{ scale_x, scale_y });
new_sprite.SetRotation(angle);
}
else if(!p_scene->IsTextureAtGivenDrawLayer(texture, m_draw_layer))
else if(!p_scene->IsTextureAtGivenDrawLayer(texture, m_draw_layer))
p_scene->BringToDrawLayer(sprite.Get(), m_draw_layer);
}