Fixed: under certain circumstances controls would not be drawn despite a call to setNeedsDisplay:YES. A typical symptom of this was custom CPViews' drawRect never being called. The error was caused by _CPDisplayServer throwing away its remaining work whenever the display code of a control called setNeedsLayout.

This commit is contained in:
Alexander Ljungberg authored and Francisco Ryan Tolmasky I committed 2010-01-19 14:45:47 -08:00
1 parent 204df99375
commit ded413481c
1 file changed
+4 -4
+4 -4
View File
@@ -28,10 +28,10 @@ PREPARE_DOM_OPTIMIZATION();
var displayObjects = [],
displayObjectsByUID = { },
layoutObjects = [],
layoutObjectsByUID = { },
runLoop = [CPRunLoop mainRunLoop];
function _CPDisplayServerAddDisplayObject(anObject)
@@ -44,7 +44,7 @@ function _CPDisplayServerAddDisplayObject(anObject)
var index = displayObjects.length;
displayObjectsByUID[UID] = index;
displayObjects[index] = anObject;
displayObjects[index] = anObject;
}
function _CPDisplayServerAddLayoutObject(anObject)
@@ -100,7 +100,7 @@ function _CPDisplayServerAddLayoutObject(anObject)
displayObjectsByUID = { };
}
else
displayObjects = displayObjects.splice(0, index);
displayObjects.splice(0, index);
}
[runLoop performSelector:@selector(run) target:self argument:nil order:0 modes:[CPDefaultRunLoopMode]];