mirror of https://github.com/raysan5/raylib
Fixes #2408
This commit is contained in:
parent
65f28460a1
commit
ca12ef48e9
|
@ -41,8 +41,7 @@ int main(void)
|
|||
//----------------------------------------------------------------------------------
|
||||
mousePosition = GetMousePosition();
|
||||
|
||||
if (CheckCollisionPointRec(mousePosition, rec) &&
|
||||
CheckCollisionPointRec(mousePosition, (Rectangle){ rec.x + rec.width - MOUSE_SCALE_MARK_SIZE, rec.y + rec.height - MOUSE_SCALE_MARK_SIZE, MOUSE_SCALE_MARK_SIZE, MOUSE_SCALE_MARK_SIZE }))
|
||||
if (CheckCollisionPointRec(mousePosition, (Rectangle){ rec.x + rec.width - MOUSE_SCALE_MARK_SIZE, rec.y + rec.height - MOUSE_SCALE_MARK_SIZE, MOUSE_SCALE_MARK_SIZE, MOUSE_SCALE_MARK_SIZE }))
|
||||
{
|
||||
mouseScaleReady = true;
|
||||
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) mouseScaleMode = true;
|
||||
|
@ -56,9 +55,14 @@ int main(void)
|
|||
rec.width = (mousePosition.x - rec.x);
|
||||
rec.height = (mousePosition.y - rec.y);
|
||||
|
||||
// Check minimum rec size
|
||||
if (rec.width < MOUSE_SCALE_MARK_SIZE) rec.width = MOUSE_SCALE_MARK_SIZE;
|
||||
if (rec.height < MOUSE_SCALE_MARK_SIZE) rec.height = MOUSE_SCALE_MARK_SIZE;
|
||||
|
||||
// Check maximum rec size
|
||||
if (rec.width > (GetScreenWidth() - rec.x)) rec.width = GetScreenWidth() - rec.x;
|
||||
if (rec.height > (GetScreenHeight() - rec.y)) rec.height = GetScreenHeight() - rec.y;
|
||||
|
||||
if (IsMouseButtonReleased(MOUSE_BUTTON_LEFT)) mouseScaleMode = false;
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue