[haiku-commits] haiku: hrev49643 - src/kits/interface headers/os/interface

  • From: jessica.l.hamilton@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 15 Sep 2015 03:00:14 +0200 (CEST)

hrev49643 adds 2 changesets to branch 'master'
old head: c8bd1b0ad097d20693307d1938ab8b7091c5d9d3
new head: 31b0eb9f53075949b871a103bd4a6a8b26812d50
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=31b0eb9f5307+%5Ec8bd1b0ad097

----------------------------------------------------------------------------

93244a65e6b9: 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.

31b0eb9f5307: BWindow::MoveOnScreen(), fix parentheses warning.

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

----------------------------------------------------------------------------

3 files changed, 7 insertions(+), 5 deletions(-)
headers/os/interface/ScrollView.h | 2 +-
src/kits/interface/ScrollView.cpp | 6 ++++--
src/kits/interface/Window.cpp | 4 ++--

############################################################################

Commit: 93244a65e6b96b37b4fe39e7e1d512b91c007721
URL: http://cgit.haiku-os.org/haiku/commit/?id=93244a65e6b9
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Tue Sep 15 00:34:19 2015 UTC

Ticket: https://dev.haiku-os.org/ticket/12380

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.

----------------------------------------------------------------------------

diff --git a/headers/os/interface/ScrollView.h
b/headers/os/interface/ScrollView.h
index a3d1792..7abec2d 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 ff4a4bc..029c083 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)

############################################################################

Revision: hrev49643
Commit: 31b0eb9f53075949b871a103bd4a6a8b26812d50
URL: http://cgit.haiku-os.org/haiku/commit/?id=31b0eb9f5307
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Tue Sep 15 00:51:07 2015 UTC

BWindow::MoveOnScreen(), fix parentheses warning.

----------------------------------------------------------------------------

diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp
index 1979b9e..f87e4f3 100644
--- a/src/kits/interface/Window.cpp
+++ b/src/kits/interface/Window.cpp
@@ -2594,8 +2594,8 @@ BWindow::MoveOnScreen(uint32 flags)
ResizeTo(frame.Width(), frame.Height());
}

- if ((flags & B_MOVE_IF_PARTIALLY_OFFSCREEN) == 0
- && !screenFrame.Contains(frame)
+ if (((flags & B_MOVE_IF_PARTIALLY_OFFSCREEN) == 0
+ && !screenFrame.Contains(frame))
|| !frame.Intersects(screenFrame)) {
// Off and away
CenterOnScreen();


Other related posts:

  • » [haiku-commits] haiku: hrev49643 - src/kits/interface headers/os/interface - jessica . l . hamilton