diff options
author | das <das> | 2007-10-11 14:13:59 (GMT) |
---|---|---|
committer | das <das> | 2007-10-11 14:13:59 (GMT) |
commit | cdb0b036e4055a74e7660cf823ff1a7bd4395197 (patch) | |
tree | f569c6aca3cfa50502bce0a78025f8315937f344 /macosx | |
parent | b033f3ea04a23df218576470b7980a523b9117f9 (diff) | |
download | tk-cdb0b036e4055a74e7660cf823ff1a7bd4395197.zip tk-cdb0b036e4055a74e7660cf823ff1a7bd4395197.tar.gz tk-cdb0b036e4055a74e7660cf823ff1a7bd4395197.tar.bz2 |
* macosx/tkMacOSXWm.c (TkMacOSXGrowToplevel): manually constrain resize
limitBounds to maxBounds, works around SectRect() mis-feature (return
zero rect if input rect has zero height/width). [Bug 1810818]
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXWm.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 3a0c0d5..9eb152a 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXWm.c,v 1.7.2.42 2007/06/29 03:22:02 das Exp $ + * RCS: @(#) $Id: tkMacOSXWm.c,v 1.7.2.43 2007/10/11 14:13:59 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -4528,7 +4528,18 @@ TkMacOSXGrowToplevel( limitBounds.top = limits.top + (strBounds.top + strWidths.top); limitBounds.bottom = limits.bottom + (strBounds.top + strWidths.top + strWidths.bottom); - SectRect(&limitBounds, maxBounds, &limitBounds); + if (limitBounds.left < maxBounds->left) { + limitBounds.left = maxBounds->left; + } + if (limitBounds.right > maxBounds->right) { + limitBounds.right = maxBounds->right; + } + if (limitBounds.top < maxBounds->top) { + limitBounds.top = maxBounds->top; + } + if (limitBounds.bottom > maxBounds->bottom) { + limitBounds.bottom = maxBounds->bottom; + } limits.left = limitBounds.left - (strBounds.left + strWidths.left); limits.right = limitBounds.right - (strBounds.left + strWidths.left + strWidths.right); |