Commits

Jason Harris  committed ba27fe3

- Fix crash on resize reported by several testers on OSX snow leopard.
- Fixed by not calling adjustSubviews in splitView:resizeSubviewsWithOldSize:

  • Participants
  • Parent commits d38ca52

Comments (0)

Files changed (1)

File Classes/Document/MacHgDocument.m

 - (CGFloat)splitView:(NSSplitView*)splitView constrainSplitPosition:(CGFloat)proposedPosition		 ofSubviewAt:(NSInteger)dividerIndex	{ return constrainFloat(proposedPosition, 150.0, 400.0); }
 
 - (void) splitView:(NSSplitView*)splitView resizeSubviewsWithOldSize:(NSSize)oldSize
-{	
-	NSRect sidebarGroupFrame	= [sidebarGroup frame];
-	NSRect contentGroupFrame	= [contentGroup frame];
+{
+	NSRect splitViewFrame        = [self frame];
+	NSRect sidebarGroupFrame	 = [sidebarGroup frame];
+	NSRect contentGroupFrame	 = [contentGroup frame];
+	CGFloat dividerThickness     = [self dividerThickness];
 	sidebarGroupFrame.size.width = constrainFloat(sidebarGroupFrame.size.width, 150.0, 400.0);
-	contentGroupFrame.size.width = self.frame.size.width - sidebarGroupFrame.size.width;
-	contentGroupFrame.origin.x = sidebarGroupFrame.size.width;
+	
+	contentGroupFrame.size.width = splitViewFrame.size.width - sidebarGroupFrame.size.width - dividerThickness;
+	contentGroupFrame.origin.x = splitViewFrame.size.width - contentGroupFrame.size.width;
+	sidebarGroupFrame.size.height = splitViewFrame.size.height;
+	contentGroupFrame.size.height = splitViewFrame.size.height;
+	
 	[contentGroup setFrame:contentGroupFrame];
 	[sidebarGroup setFrame:sidebarGroupFrame];
-	[self adjustSubviews];
 }
 
 - (NSRect) splitView:(NSSplitView*)splitView additionalEffectiveRectOfDividerAtIndex:(NSInteger)dividerIndex