diff options
-rw-r--r-- | tests/scrollbar.test | 1 | ||||
-rw-r--r-- | unix/tkUnixScrlbr.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/scrollbar.test b/tests/scrollbar.test index 6f00e78..dcfc711 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -24,6 +24,7 @@ proc getTroughSize {w} { return [expr [winfo width $w] - 2*[testmetrics cxhscroll $w]] } } else { + # Calculations here assume that the arrow area is a square. if [string match v* [$w cget -orient]] { return [expr [winfo height $w] \ - ([winfo width $w] \ diff --git a/unix/tkUnixScrlbr.c b/unix/tkUnixScrlbr.c index 0507211..2446c3f 100644 --- a/unix/tkUnixScrlbr.c +++ b/unix/tkUnixScrlbr.c @@ -289,6 +289,11 @@ TkpComputeScrollbarGeometry( scrollPtr->inset = scrollPtr->highlightWidth + scrollPtr->borderWidth; width = (scrollPtr->vertical) ? Tk_Width(scrollPtr->tkwin) : Tk_Height(scrollPtr->tkwin); + + /* + * Next line assumes that the arrow area is a square. + */ + scrollPtr->arrowLength = width - 2*scrollPtr->inset + 1; fieldLength = (scrollPtr->vertical ? Tk_Height(scrollPtr->tkwin) : Tk_Width(scrollPtr->tkwin)) |