summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-05-24 13:10:45 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-05-24 13:10:45 (GMT)
commit30e249e0591e48bc1c72c7668ed59dcc7b8df2f8 (patch)
tree87ef73cbd3340e2f2277b28cd95fa38d410ae52b
parentd1c48d32205766e74234558200f846f04f04c2ae (diff)
downloadtk-30e249e0591e48bc1c72c7668ed59dcc7b8df2f8.zip
tk-30e249e0591e48bc1c72c7668ed59dcc7b8df2f8.tar.gz
tk-30e249e0591e48bc1c72c7668ed59dcc7b8df2f8.tar.bz2
Limit sash proxy maximum coordinates to the size of the panedwindow it belongs tobug_d7bad57c43
-rw-r--r--generic/tkPanedWindow.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c
index 3ae473a..e07fc51 100644
--- a/generic/tkPanedWindow.c
+++ b/generic/tkPanedWindow.c
@@ -2764,6 +2764,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) {
@@ -2813,11 +2814,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));
@@ -2825,6 +2831,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) -