8000 Simplify resizing a bit on macosx · matplotlib/matplotlib@a3f0999 · GitHub
[go: up one dir, main page]

Skip to content

Commit a3f0999

Browse files
committed
Simplify resizing a bit on macosx
Just set some resizing flags on the view. This allows us to avoid manually resizing the view.
1 parent b659641 commit a3f0999

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/_macosx.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ static CGFloat _get_device_scale(CGContextRef cr)
337337

338338
NSRect rect = NSMakeRect(0.0, 0.0, width, height);
339339
self->view = [self->view initWithFrame: rect];
340+
self->view.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
340341
int opts = (NSTrackingMouseEnteredAndExited |
341342
NSTrackingActiveInKeyWindow | NSTrackingInVisibleRect);
342343
[self->view addTrackingArea: [
@@ -1708,8 +1709,6 @@ - (void)windowDidResize: (NSNotification*)notification
17081709
width = size.width;
17091710
height = size.height;
17101711

1711-
[self setFrameSize: size];
1712-
17131712
PyGILState_STATE gstate = PyGILState_Ensure();
17141713
PyObject* result = PyObject_CallMethod(
17151714
canvas, "resize", "ii", width, height);

0 commit comments

Comments
 (0)
0