diff options
author | fvogel <fvogelnew1@free.fr> | 2015-06-01 18:27:32 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2015-06-01 18:27:32 (GMT) |
commit | fb2a611039436e82e09406f4777cc89efc56a1fe (patch) | |
tree | 6f6055d5408e3c63176a33d76436597fda5fbd54 | |
parent | ec84450fb953dbe94b63a749ccb29f8522bf2fc3 (diff) | |
parent | f0cfd95b355f536f0d9a4139138e99447a7bd127 (diff) | |
download | tk-fb2a611039436e82e09406f4777cc89efc56a1fe.zip tk-fb2a611039436e82e09406f4777cc89efc56a1fe.tar.gz tk-fb2a611039436e82e09406f4777cc89efc56a1fe.tar.bz2 |
Fixed bug [d7bad57c43] - Limited sash proxy maximum coordinates to the size of the panedwindow it belongs to
-rw-r--r-- | generic/tkPanedWindow.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index c49595b..c7a1195 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -2771,6 +2771,7 @@ PanedWindowProxyCommand( PROXY_COORD, PROXY_FORGET, PROXY_PLACE }; int index, x, y, sashWidth, sashHeight; + int internalBW, pwWidth, pwHeight; Tcl_Obj *coords[2]; if (objc < 3) { @@ -2820,11 +2821,16 @@ PanedWindowProxyCommand( return TCL_ERROR; } + internalBW = Tk_InternalBorderWidth(pwPtr->tkwin); if (pwPtr->orient == ORIENT_HORIZONTAL) { if (x < 0) { x = 0; } - y = Tk_InternalBorderWidth(pwPtr->tkwin); + pwWidth = Tk_Width(pwPtr->tkwin) - (2 * internalBW); + if (x > pwWidth) { + x = pwWidth; + } + y = Tk_InternalBorderWidth(pwPtr->tkwin); sashWidth = pwPtr->sashWidth; sashHeight = Tk_Height(pwPtr->tkwin) - (2 * Tk_InternalBorderWidth(pwPtr->tkwin)); @@ -2832,6 +2838,10 @@ PanedWindowProxyCommand( if (y < 0) { y = 0; } + pwHeight = Tk_Height(pwPtr->tkwin) - (2 * internalBW); + if (y > pwHeight) { + y = pwHeight; + } x = Tk_InternalBorderWidth(pwPtr->tkwin); sashHeight = pwPtr->sashWidth; sashWidth = Tk_Width(pwPtr->tkwin) - |