Update portable_window.c

This commit is contained in:
Ray 2023-05-28 11:13:21 +02:00
parent 6650ad0ffa
commit 4f48e5a3c7

View File

@ -53,7 +53,7 @@ int main()
//----------------------------------------------------------------------------------
mousePosition = GetMousePosition();
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON) && !dragWindow)
{
if (CheckCollisionPointRec(mousePosition, (Rectangle){ 0, 0, screenWidth, 20 }))
{
@ -67,9 +67,9 @@ int main()
windowPosition.x += (mousePosition.x - panOffset.x);
windowPosition.y += (mousePosition.y - panOffset.y);
if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) dragWindow = false;
SetWindowPosition(windowPosition.x, windowPosition.y);
if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) dragWindow = false;
}
//----------------------------------------------------------------------------------