From e0c8ae633596e1de72be4b079bb0da34730696d0 Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Sun, 18 Mar 2012 14:02:14 +0000 Subject: [PATCH] Minor outline view optimisation: don't apply a context rotation of 0 degrees. --- AppKit/CPOutlineView.j | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/AppKit/CPOutlineView.j b/AppKit/CPOutlineView.j index 72692067d..29fcb498b 100644 --- a/AppKit/CPOutlineView.j +++ b/AppKit/CPOutlineView.j @@ -1911,10 +1911,13 @@ var _loadItemInfoForItem = function(/*CPOutlineView*/ anOutlineView, /*id*/ anIt CGContextBeginPath(context); - var centre = _CGPointMake(FLOOR(_CGRectGetWidth(bounds) / 2.0), FLOOR(_CGRectGetHeight(bounds) / 2.0)); - CGContextTranslateCTM(context, centre.x, centre.y); - CGContextRotateCTM(context, _angle); - CGContextTranslateCTM(context, -centre.x, -centre.y); + if (_angle) + { + var centre = _CGPointMake(FLOOR(_CGRectGetWidth(bounds) / 2.0), FLOOR(_CGRectGetHeight(bounds) / 2.0)); + CGContextTranslateCTM(context, centre.x, centre.y); + CGContextRotateCTM(context, _angle); + CGContextTranslateCTM(context, -centre.x, -centre.y); + } // Center, but crisp. CGContextTranslateCTM(context, FLOOR((_CGRectGetWidth(bounds) - 9.0) / 2.0), FLOOR((_CGRectGetHeight(bounds) - 8.0) / 2.0)); @@ -1938,7 +1941,6 @@ var _loadItemInfoForItem = function(/*CPOutlineView*/ anOutlineView, /*id*/ anIt CGContextAddLineToPoint(context, 4.5, 8.0); CGContextAddLineToPoint(context, 9.0, 0.0); } - else CGContextAddLineToPoint(context, 4.5, 8.0);