mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
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:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user