0
0
mirror of https://github.com/Nimac0/SDL_Minigame synced 2026-01-13 12:33:42 +00:00

minimal changes in transformcomponent::update

This commit is contained in:
ineslelin 2024-01-28 17:52:18 +01:00
parent c2cb8f9fc6
commit 00190facab

View File

@ -54,8 +54,7 @@ void TransformComponent::update()
{ {
newPos.x = 0; newPos.x = 0;
} }
else if (newPos.x + (this->width * this->scale) > SCREEN_SIZE_WIDTH)
if (newPos.x + (this->width * this->scale) > SCREEN_SIZE_WIDTH)
{ {
newPos.x = SCREEN_SIZE_WIDTH - (this->width * this->scale); newPos.x = SCREEN_SIZE_WIDTH - (this->width * this->scale);
} }
@ -64,8 +63,7 @@ void TransformComponent::update()
{ {
newPos.y = 0; newPos.y = 0;
} }
else if (newPos.y + (this->height * this->scale) > SCREEN_SIZE_HEIGHT)
if (newPos.y + (this->height * this->scale) > SCREEN_SIZE_HEIGHT)
{ {
newPos.y = SCREEN_SIZE_HEIGHT - (this->height * this->scale); newPos.y = SCREEN_SIZE_HEIGHT - (this->height * this->scale);
} }