[haiku-commits] haiku: hrev54406 - src/kits/interface

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 6 Jul 2020 21:44:25 -0400 (EDT)

hrev54406 adds 1 changeset to branch 'master'
old head: 840f23676c6602d5906a73cd3cdec27e6b59d5bc
new head: 8539dfdac26aea04445995b6f897d86bcadbdfd2
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=8539dfdac26a+%5E840f23676c66

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

8539dfdac26a: BScrollBar: Use the minimum as the preferred size in the 
alternate axis.
  
  This was the behavior before the commit yesterday that unified the
  two methods of computing the preferred size. It seems some applications
  expect this to be callable without a window lock, so this works when
  the other method does not.
  
  Fixes #16372.

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

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

Revision:    hrev54406
Commit:      8539dfdac26aea04445995b6f897d86bcadbdfd2
URL:         https://git.haiku-os.org/haiku/commit/?id=8539dfdac26a
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Tue Jul  7 01:40:51 2020 UTC

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

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

1 file changed, 3 insertions(+), 3 deletions(-)
src/kits/interface/ScrollBar.cpp | 6 +++---

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

diff --git a/src/kits/interface/ScrollBar.cpp b/src/kits/interface/ScrollBar.cpp
index ed26de53d0..34a58b5aa9 100644
--- a/src/kits/interface/ScrollBar.cpp
+++ b/src/kits/interface/ScrollBar.cpp
@@ -999,10 +999,10 @@ BScrollBar::GetPreferredSize(float* _width, float* 
_height)
                        *_width = B_V_SCROLL_BAR_WIDTH * scale;
 
                if (_height)
-                       *_height = Bounds().Height();
+                       *_height = _MinSize().Height();
        } else if (fOrientation == B_HORIZONTAL) {
                if (_width)
-                       *_width = Bounds().Width();
+                       *_width = _MinSize().Width();
 
                if (_height)
                        *_height = B_H_SCROLL_BAR_HEIGHT * scale;
@@ -1228,7 +1228,7 @@ BScrollBar::_UpdateThumbFrame()
        thumbSize = floorf(thumbSize + 0.5);
        thumbSize--;
 
-       // the thumb can be scrolled within the remaining area "maxSize - 
thumbSize - 1.0"      
+       // the thumb can be scrolled within the remaining area "maxSize - 
thumbSize - 1.0"
        float offset = 0.0;
        if (fMax > fMin) {
                offset = floorf(((fValue - fMin) / (fMax - fMin))


Other related posts:

  • » [haiku-commits] haiku: hrev54406 - src/kits/interface - waddlesplash