From ded413481c01aa122752eadaecf6b3eb08305928 Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Mon, 18 Jan 2010 23:10:20 -0300 Subject: [PATCH] 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. --- AppKit/_CPDisplayServer.j | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AppKit/_CPDisplayServer.j b/AppKit/_CPDisplayServer.j index c2dfb3e1e..294e06898 100644 --- a/AppKit/_CPDisplayServer.j +++ b/AppKit/_CPDisplayServer.j @@ -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]];