I've got a NSClipView inside of NSScrollView, showing a custom view. Whenever I change the "gridsize" ( a variable that adjusts the size of everything) it locks the top left corner and if you move around and change the "gridsize" it doesn't properly zoom to where you moved.
Is there any easy way to fix this?
Is there any easy way to fix this?
Code:
-(void) setGridSize: (int) size {
m_GridSize = size;
NSSize frameSize = NSMakeSize((m_PlayFieldData.size.width+2)*m_GridSize, (m_PlayFieldData.size.height+2)*m_GridSize);
frameSize.width = MAX(frameSize.width, self.superview.frame.size.width);
frameSize.height = MAX(frameSize.height, self.superview.frame.size.height);
[self setFrameSize: frameSize];
NSClipView *clipView = (NSClipView *)[self superview];
NSScrollView *scrollview = (NSScrollView *)[clipView superview];
[scrollview reflectScrolledClipView: clipView];
[self setNeedsDisplay: YES];
}