fixing rotation

This commit is contained in:
2024-11-14 11:44:52 +01:00
parent c6aaa4e2fa
commit ef50272a0c
5 changed files with 13 additions and 13 deletions

View File

@@ -54,7 +54,6 @@ namespace mlx
Text& new_text = p_scene->CreateText(str);
new_text.SetPosition(Vec2f{ static_cast<float>(x), static_cast<float>(y) });
new_text.SetColor(std::move(vec_color));
new_text.SetCenter(Vec2f{ 0.0f, 0.0f });
}
else if(!p_scene->IsTextAtGivenDrawLayer(str, m_draw_layer))
p_scene->BringToDrawLayer(text.Get(), m_draw_layer);
@@ -72,10 +71,10 @@ namespace mlx
m_pixelput_called = false;
}
Sprite& new_sprite = p_scene->CreateSprite(texture);
new_sprite.SetCenter(Vec2f{ texture->GetWidth() / 2.0f, texture->GetHeight() / 2.0f });
new_sprite.SetPosition(Vec2f{ static_cast<float>(x), static_cast<float>(y) });
new_sprite.SetScale(Vec2f{ scale, scale });
new_sprite.SetRotation(angle);
new_sprite.SetCenter(Vec2f{ texture->GetWidth() / 2.0f, texture->GetHeight() / 2.0f });
}
else if(!p_scene->IsTextureAtGivenDrawLayer(texture, m_draw_layer))
p_scene->BringToDrawLayer(sprite.Get(), m_draw_layer);