From deca617c6b53937783f4fd22b641d838707ce500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Fri, 30 Jun 2006 19:24:06 +0000 Subject: [PATCH] position is relative : add to the top left point of the original rect fixes bug #700 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17987 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Shelf.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/kits/interface/Shelf.cpp b/src/kits/interface/Shelf.cpp index c4a9e95bd2..565b21507e 100644 --- a/src/kits/interface/Shelf.cpp +++ b/src/kits/interface/Shelf.cpp @@ -358,16 +358,13 @@ _TContainerViewFilter_::ObjectDropFilter(BMessage *msg, BHandler **_handler) else dragger = NULL; - if (dragger->fRelation == BDragger::TARGET_IS_CHILD) { - BRect rect = dragger->Frame(); - rect.OffsetTo(point); - point = fShelf->AdjustReplicantBy(rect, msg); - - } else { - BRect rect = dragger->fTarget->Frame(); - rect.OffsetTo(point); - point = fShelf->AdjustReplicantBy(rect, msg); - } + BRect rect; + if (dragger->fRelation == BDragger::TARGET_IS_CHILD) + rect = dragger->Frame(); + else + rect = dragger->fTarget->Frame(); + rect.OffsetTo(point); + point = rect.LeftTop() + fShelf->AdjustReplicantBy(rect, msg); if (dragger->fRelation == BDragger::TARGET_IS_PARENT) dragger->fTarget->MoveTo(point);