Fix computation of zoomed window frame

When computing the zoomed window frame ensure that it is constrained to
hold an even number of rows and columns.  This fixes a problem where the
window would not "un-zoom" after being zoomed.
This commit is contained in:
Bjorn Winckler
2008-10-18 13:23:24 +02:00
parent 467b890d13
commit 1a91b2a5c9
+13
View File
@@ -762,6 +762,19 @@
BOOL zoomBoth = [[NSUserDefaults standardUserDefaults]
boolForKey:MMZoomBothKey];
// The "default frame" represents the maximal size of a zoomed window.
// Constrain this frame so that the content fits an even number of rows and
// columns.
NSRect contentRect = [decoratedWindow contentRectForFrameRect:frame];
NSSize constrainedSize = [vimView constrainRows:NULL
columns:NULL
toSize:contentRect.size];
contentRect.origin.y += contentRect.size.height - constrainedSize.height;
contentRect.size = constrainedSize;
frame = [decoratedWindow frameRectForContentRect:contentRect];
if (!((zoomBoth && !cmdLeftClick) || (!zoomBoth && cmdLeftClick))) {
// Zoom in horizontal direction only.
NSRect currentFrame = [win frame];