Commits

Peter Hosey  committed b2b68a6

Finally fixed the bug where resizing the split view, quitting, and relaunching would cause warning messages from NSSplitView in the Console log. The problem was that we weren't subtracting the non-resizable views' sizes from the denominator of the division expressions.

I may even be able to get rid of that ceil call, now.

  • Participants
  • Parent commits 22a30cb

Comments (0)

Files changed (1)

File PRHAutoresizingSplitViewDelegate.m

 		subviewsAreResizable[i] = 0 != ([subviews[i] autoresizingMask] & (isVertical ? NSViewWidthSizable : NSViewHeightSizable));
 
 		NSRect frame = [subviews[i] frame];
-		//We start out populating subviewProportionsOrSizes with absolute sizes only. We'll convert the resizable views' sizes to proportions once we've finished the total.
+		//We start out populating subviewProportionsOrSizes with absolute sizes only. We'll convert the resizable views' sizes to proportions once we've removed any non-resizable views from the total.
 		subviewProportionsOrSizes[i] = isVertical ? frame.size.width : frame.size.height;
-		if (subviewsAreResizable[i]) {
+		if (!(subviewsAreResizable[i])) {
+			totalFormerSizes -= subviewProportionsOrSizes[i];
+			totalNewSizes    -= subviewProportionsOrSizes[i];
+		}
+	}
+	for (NSUInteger i = 0U; i < numSubviews; ++i) {
+		subviewsAreResizable[i] = 0 != ([subviews[i] autoresizingMask] & (isVertical ? NSViewWidthSizable : NSViewHeightSizable));
+
+		if (subviewsAreResizable[i])
 			subviewProportionsOrSizes[i] = subviewProportionsOrSizes[i] / totalFormerSizes;
-		} else
+		else
 			--numResizableSubviews;
 	}