Don't updateSizeAndPosition on setPos as it might change texture and that isn't threadsafe

This commit is contained in:
zv0n 2021-05-25 20:21:26 +02:00
parent 670d5b7c1b
commit bd8a841e6f
2 changed files with 2 additions and 1 deletions

View File

@ -42,7 +42,7 @@ void RenderObject::setPos( const std::pair< double, double > &pos ) {
}
void RenderObject::setPos( const Vec2D< double > &vec ) {
original = vec;
updateSizeAndPosition();
// updateSizeAndPosition();
}
Vec2D< double > RenderObject::getPos() const {
return original;

View File

@ -85,6 +85,7 @@ void TextRenderer::updateTexture() {
}
void TextRenderer::updateSizeAndPosition() {
RectangleRender::updateSizeAndPosition();
// TODO only if size actually changed
updateTexture();
updateDstRect();
}