BScrollView: _ComputeFrame(BRect,...) used incorrect insets.

Previously, the BRect would be expanded by the call to
InsetBy(), but the replacement _InsetBorders() forgot to
take this into account.

Fixes #12380.
This commit is contained in:
Jessica Hamilton
2015-09-15 00:39:23 +00:00
parent c8bd1b0ad0
commit 93244a65e6
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ private:
static float _BorderSize(border_style border); static float _BorderSize(border_style border);
static int32 _ModifyFlags(int32 flags, border_style border); static int32 _ModifyFlags(int32 flags, border_style border);
static void _InsetBorders(BRect& frame, border_style border, static void _InsetBorders(BRect& frame, border_style border,
uint32 borders); uint32 borders, bool expand = false);
private: private:
BView* fTarget; BView* fTarget;
BScrollBar* fHorizontalScrollBar; BScrollBar* fHorizontalScrollBar;
+4 -2
View File
@@ -888,7 +888,7 @@ BScrollView::_ComputeFrame(BRect frame, bool horizontal, bool vertical,
if (horizontal) if (horizontal)
frame.bottom += B_H_SCROLL_BAR_HEIGHT; frame.bottom += B_H_SCROLL_BAR_HEIGHT;
_InsetBorders(frame, border, borders); _InsetBorders(frame, border, borders, true);
if (_BorderSize(border) == 0) { if (_BorderSize(border) == 0) {
if (vertical) if (vertical)
@@ -940,9 +940,11 @@ BScrollView::_ModifyFlags(int32 flags, border_style border)
/*static*/ void /*static*/ void
BScrollView::_InsetBorders(BRect& frame, border_style border, uint32 borders) BScrollView::_InsetBorders(BRect& frame, border_style border, uint32 borders, bool expand)
{ {
float borderSize = _BorderSize(border); float borderSize = _BorderSize(border);
if (expand)
borderSize = -borderSize;
if ((borders & BControlLook::B_LEFT_BORDER) != 0) if ((borders & BControlLook::B_LEFT_BORDER) != 0)
frame.left += borderSize; frame.left += borderSize;
if ((borders & BControlLook::B_TOP_BORDER) != 0) if ((borders & BControlLook::B_TOP_BORDER) != 0)