From 7cf46d715e08b8a355ef9ea7be5421a2710d65fc Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Wed, 29 Dec 2004 20:41:14 +0000 Subject: Ported the npc text dialog and some other small updates. --- src/gui/window.cpp | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'src/gui/window.cpp') diff --git a/src/gui/window.cpp b/src/gui/window.cpp index 4d386071..632ad303 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -172,9 +172,6 @@ void Window::add(Widget *w, int x, int y) void Window::mousePress(int mx, int my, int button) { - int x = this->getDimension().x; - int y = this->getDimension().y; - mouseDown = true; mousePX = mx; @@ -199,24 +196,16 @@ void Window::mouseMotion(int mx, int my) y = y - (mousePY - my); // Keep guichan window inside window - if (x < 0) - x = 0; - if (y < 0) - y = 0; - if (x + winWidth > 799) - x = 799 - winWidth; - if (y + winHeight > 599) - y = 599 - winHeight; + if (x < 0) x = 0; + if (y < 0) y = 0; + if (x + winWidth > 799) x = 799 - winWidth; + if (y + winHeight > 599) y = 599 - winHeight; // Snap window to edges - if (x < snapSize) - x = 0; - if (y < snapSize) - y = 0; - if (x + winWidth + snapSize > 799) - x = 799 - winWidth; - if (y + winHeight + snapSize > 599) - y = 599 - winHeight; + if (x < snapSize) x = 0; + if (y < snapSize) y = 0; + if (x + winWidth + snapSize > 799) x = 799 - winWidth; + if (y + winHeight + snapSize > 599) y = 599 - winHeight; this->setPosition(x, y); } -- cgit v1.2.3-70-g09d2