From 0ce97290a9b89ab6698de34194b7a4dfc64255ee Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 24 Sep 2018 19:59:29 +0000 Subject: Fix [050d1ea747]: scrollbar-3.50, 6.11, 6.12, 6.25, 6.39 tests fail on macOS --- macosx/tkMacOSXScrlbr.c | 21 ++++++++------------- 1 file 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=width-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; } -- cgit v0.12