From 5929c56ed0c40e4b46a02c444dbe1a7a015b49fe Mon Sep 17 00:00:00 2001 From: Adi Oanca Date: Fri, 18 Jun 2004 18:10:07 +0000 Subject: [PATCH] ::MoveBy() fixed. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8054 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Window.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index 7b6ce24f36..63a99cc30a 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -1727,10 +1727,12 @@ BView* BWindow::LastMouseMovedView() const{ //------------------------------------------------------------------------------ void BWindow::MoveBy(float dx, float dy){ - - BPoint offset( dx, dy ); - - MoveTo( fFrame.LeftTop() + offset ); + Lock(); + session->WriteInt32( AS_WINDOW_MOVE ); + session->WriteFloat( dx ); + session->WriteFloat( dy ); + session->Sync(); + Unlock(); } //------------------------------------------------------------------------------ @@ -1742,13 +1744,7 @@ void BWindow::MoveTo( BPoint point ){ //------------------------------------------------------------------------------ void BWindow::MoveTo(float x, float y){ - - Lock(); - session->WriteInt32( AS_WINDOW_MOVE ); - session->WriteFloat( x ); - session->WriteFloat( y ); - session->Sync(); - Unlock(); + MoveBy(x - fFrame.left, y - fFrame.top); } //------------------------------------------------------------------------------