From 93244a65e6b96b37b4fe39e7e1d512b91c007721 Mon Sep 17 00:00:00 2001 From: Jessica Hamilton Date: Tue, 15 Sep 2015 00:34:19 +0000 Subject: [PATCH] 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. --- headers/os/interface/ScrollView.h | 2 +- src/kits/interface/ScrollView.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/headers/os/interface/ScrollView.h b/headers/os/interface/ScrollView.h index a3d1792a04..7abec2d5f4 100644 --- a/headers/os/interface/ScrollView.h +++ b/headers/os/interface/ScrollView.h @@ -116,7 +116,7 @@ private: static float _BorderSize(border_style border); static int32 _ModifyFlags(int32 flags, border_style border); static void _InsetBorders(BRect& frame, border_style border, - uint32 borders); + uint32 borders, bool expand = false); private: BView* fTarget; BScrollBar* fHorizontalScrollBar; diff --git a/src/kits/interface/ScrollView.cpp b/src/kits/interface/ScrollView.cpp index ff4a4bcd82..029c083e1b 100644 --- a/src/kits/interface/ScrollView.cpp +++ b/src/kits/interface/ScrollView.cpp @@ -888,7 +888,7 @@ BScrollView::_ComputeFrame(BRect frame, bool horizontal, bool vertical, if (horizontal) frame.bottom += B_H_SCROLL_BAR_HEIGHT; - _InsetBorders(frame, border, borders); + _InsetBorders(frame, border, borders, true); if (_BorderSize(border) == 0) { if (vertical) @@ -940,9 +940,11 @@ BScrollView::_ModifyFlags(int32 flags, border_style border) /*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); + if (expand) + borderSize = -borderSize; if ((borders & BControlLook::B_LEFT_BORDER) != 0) frame.left += borderSize; if ((borders & BControlLook::B_TOP_BORDER) != 0)