* GormCore/GormPalettesManager.m (resizeWithOldSuperviewSize:): new method.

Fixes correct placement of palette view on panel resize.
(init): disable auroresizing of dragView.
This commit is contained in:
Sergii Stoian 2019-12-23 15:48:30 +02:00
parent f227f3008b
commit 98befb031c

View file

@ -99,6 +99,16 @@ static NSImage *dragImage = nil;
[super dealloc];
}
- (void) resizeWithOldSuperviewSize: (NSSize)oldSize
{
NSSize newSize = [[self superview] frame].size;
NSRect frame = [self frame];
frame.origin.x -= floorf((oldSize.width - newSize.width) / 2);
frame.origin.y -= floorf((oldSize.height - newSize.height) / 2);
[self setFrameOrigin: frame.origin];
}
/*
* Dragging source protocol implementation
*/
@ -341,7 +351,7 @@ static NSImage *dragImage = nil;
RELEASE(scrollView);
dragView = [[GormPaletteView alloc] initWithFrame: dragRect];
[dragView setAutoresizingMask: NSViewMinYMargin];
[dragView setAutoresizingMask: 0];
[[panel contentView] addSubview: dragView];
RELEASE(dragView);