From df2b4726b205a1ba341ee232a298d464a34c3236 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 19 Nov 2010 14:37:54 +0000 Subject: [PATCH] BLayoutUtils::MoveIntoFrame(): Fixed check. Spotted by korli. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39509 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/LayoutUtils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/LayoutUtils.cpp b/src/kits/interface/LayoutUtils.cpp index af40fe0c21..577da47d82 100644 --- a/src/kits/interface/LayoutUtils.cpp +++ b/src/kits/interface/LayoutUtils.cpp @@ -219,13 +219,13 @@ BLayoutUtils::MoveIntoFrame(BRect rect, BSize frameSize) // enforce horizontal limits; favor left edge if (rect.right > frameSize.width) leftTop.x -= rect.right - frameSize.width; - if (rect.left < 0) + if (leftTop.x < 0) leftTop.x = 0; // enforce vertical limits; favor top edge if (rect.bottom > frameSize.height) leftTop.y -= rect.bottom - frameSize.height; - if (rect.top < 0) + if (leftTop.y < 0) leftTop.y = 0; return rect.OffsetToSelf(leftTop);