summaryrefslogtreecommitdiff
path: root/src/gui/window.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-07-11 10:31:03 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-07-11 10:31:03 +0000
commit12357db93c457675381c53caae226c900db07c8d (patch)
treeaa66960502a969048761c81a3d2ba65363280b10 /src/gui/window.cpp
parent2aab954cf063fdbc21d3681c227dbe06cf0d270e (diff)
downloadmana-12357db93c457675381c53caae226c900db07c8d.tar.gz
mana-12357db93c457675381c53caae226c900db07c8d.tar.bz2
mana-12357db93c457675381c53caae226c900db07c8d.tar.xz
mana-12357db93c457675381c53caae226c900db07c8d.zip
Merged Guichan 0.7.0 fix from 0.0 branch.
Diffstat (limited to 'src/gui/window.cpp')
-rw-r--r--src/gui/window.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index 8a052bba..5c39c04e 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -339,10 +339,11 @@ void Window::mousePressed(gcn::MouseEvent &event)
mMouseResize |= (y > getHeight() - resizeBorderWidth) ? BOTTOM :
(y < resizeBorderWidth) ? TOP : 0;
}
- else if (event.getSource() == mGrip)
+ else if (event.getSource() == mGrip &&
+ event.getButton() == gcn::MouseEvent::LEFT)
{
- mDragOffsetX = x + mGrip->getX();
- mDragOffsetY = y + mGrip->getY();
+ mDragOffsetX = x;
+ mDragOffsetY = y;
mMouseResize |= BOTTOM | RIGHT;
mIsMoving = false;
}
@@ -365,10 +366,8 @@ void Window::mouseDragged(gcn::MouseEvent &event)
if (mMouseResize && !mIsMoving)
{
- const int dx = event.getX() - mDragOffsetX +
- ((event.getSource() == mGrip) ? mGrip->getX() : 0);
- const int dy = event.getY() - mDragOffsetY +
- ((event.getSource() == mGrip) ? mGrip->getY() : 0);
+ const int dx = event.getX() - mDragOffsetX;
+ const int dy = event.getY() - mDragOffsetY;
gcn::Rectangle newDim = getDimension();
if (mMouseResize & (TOP | BOTTOM))