Update portable_window.c
This commit is contained in:
parent
6650ad0ffa
commit
4f48e5a3c7
@ -53,7 +53,7 @@ int main()
|
|||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
mousePosition = GetMousePosition();
|
mousePosition = GetMousePosition();
|
||||||
|
|
||||||
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
|
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON) && !dragWindow)
|
||||||
{
|
{
|
||||||
if (CheckCollisionPointRec(mousePosition, (Rectangle){ 0, 0, screenWidth, 20 }))
|
if (CheckCollisionPointRec(mousePosition, (Rectangle){ 0, 0, screenWidth, 20 }))
|
||||||
{
|
{
|
||||||
@ -66,10 +66,10 @@ int main()
|
|||||||
{
|
{
|
||||||
windowPosition.x += (mousePosition.x - panOffset.x);
|
windowPosition.x += (mousePosition.x - panOffset.x);
|
||||||
windowPosition.y += (mousePosition.y - panOffset.y);
|
windowPosition.y += (mousePosition.y - panOffset.y);
|
||||||
|
|
||||||
if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) dragWindow = false;
|
|
||||||
|
|
||||||
SetWindowPosition(windowPosition.x, windowPosition.y);
|
SetWindowPosition(windowPosition.x, windowPosition.y);
|
||||||
|
|
||||||
|
if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) dragWindow = false;
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user