diff options
author | fvogel <fvogelnew1@free.fr> | 2018-09-24 19:59:29 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2018-09-24 19:59:29 (GMT) |
commit | 0ce97290a9b89ab6698de34194b7a4dfc64255ee (patch) | |
tree | a772aa38e84a0e9d9d39bc235516e805181ce8d9 | |
parent | 1603ff2057cee3dfc3780d2ae7bb40d2f7ca1248 (diff) | |
download | tk-0ce97290a9b89ab6698de34194b7a4dfc64255ee.zip tk-0ce97290a9b89ab6698de34194b7a4dfc64255ee.tar.gz tk-0ce97290a9b89ab6698de34194b7a4dfc64255ee.tar.bz2 |
Fix [050d1ea747]: scrollbar-3.50, 6.11, 6.12, 6.25, 6.39 tests fail on macOS
-rw-r--r-- | macosx/tkMacOSXScrlbr.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index a8018a5..1bfbe11 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -381,25 +381,20 @@ TkpScrollbarPosition( * has to do is re-draw itself. */ - int length, fieldlength, width, tmp; + int length, width, tmp; register const int inset = scrollPtr->inset; - register const int arrowSize = scrollPtr->arrowLength + inset; if (scrollPtr->vertical) { length = Tk_Height(scrollPtr->tkwin); - fieldlength = length - 2 * arrowSize; width = Tk_Width(scrollPtr->tkwin); } else { tmp = x; x = y; y = tmp; length = Tk_Width(scrollPtr->tkwin); - fieldlength = length - 2 * arrowSize; width = Tk_Height(scrollPtr->tkwin); } - fieldlength = fieldlength < 0 ? 0 : fieldlength; - if (x<inset || x>=width-inset || y<inset || y>=length-inset) { return OUTSIDE; } @@ -409,19 +404,19 @@ TkpScrollbarPosition( * TkpDisplayScrollbar. Be sure to keep the two consistent. */ + if (y < inset + scrollPtr->arrowLength) { + return TOP_ARROW; + } if (y < scrollPtr->sliderFirst) { return TOP_GAP; } - if (y < scrollPtr->sliderLast) { + if (y < scrollPtr->sliderLast){ return SLIDER; } - if (y < fieldlength){ - return BOTTOM_GAP; - } - if (y < fieldlength + arrowSize) { - return TOP_ARROW; + if (y >= length - (scrollPtr->arrowLength + inset)) { + return BOTTOM_ARROW; } - return BOTTOM_ARROW; + return BOTTOM_GAP; } |