From 3393cede4ab318e20d8549c72f93b9f8d7d3a41a Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Mon, 8 Aug 2011 22:00:30 +0000 Subject: [Author: avi] Switch to using the class methods +saveGraphicsState/+restoreGraphicsState. R=mmentovai APPROVED=dmaclach --- AppKit/GTMFadeTruncatingTextFieldCell.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'AppKit/GTMFadeTruncatingTextFieldCell.m') diff --git a/AppKit/GTMFadeTruncatingTextFieldCell.m b/AppKit/GTMFadeTruncatingTextFieldCell.m index 66e6874..ebe4dd0 100644 --- a/AppKit/GTMFadeTruncatingTextFieldCell.m +++ b/AppKit/GTMFadeTruncatingTextFieldCell.m @@ -42,7 +42,7 @@ fadeToRight:(BOOL)fadeToRight { // Draw the gradient part with a transparency layer. This makes the text look // suboptimal, but since it fades out, that's ok. - [[NSGraphicsContext currentContext] saveGraphicsState]; + [NSGraphicsContext saveGraphicsState]; [NSBezierPath clipRect:backgroundRect]; CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort]; CGContextBeginTransparencyLayerWithRect(context, @@ -54,10 +54,10 @@ NSCompositeSourceOver); } - [[NSGraphicsContext currentContext] saveGraphicsState]; + [NSGraphicsContext saveGraphicsState]; [NSBezierPath clipRect:clipRect]; [attributedString drawInRect:titleRect]; - [[NSGraphicsContext currentContext] restoreGraphicsState]; + [NSGraphicsContext restoreGraphicsState]; NSPoint startPoint; NSPoint endPoint; @@ -77,7 +77,7 @@ NSGradientDrawsAfterEndingLocation]; CGContextEndTransparencyLayer(context); - [[NSGraphicsContext currentContext] restoreGraphicsState]; + [NSGraphicsContext restoreGraphicsState]; } - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { @@ -171,7 +171,7 @@ // Draw non-gradient part without transparency layer, as light text on a dark // background looks bad with a gradient layer. - [[NSGraphicsContext currentContext] saveGraphicsState]; + [NSGraphicsContext saveGraphicsState]; if ([self drawsBackground]) { [[self backgroundColor] set]; NSRectFillUsingOperation(solidBackgroundPart, NSCompositeSourceOver); @@ -180,7 +180,7 @@ // doesn't draw correctly if the cell draws its own background. [NSBezierPath clipRect:solidTitleClipPart]; [attributedString drawInRect:offsetTitleRect]; - [[NSGraphicsContext currentContext] restoreGraphicsState]; + [NSGraphicsContext restoreGraphicsState]; NSColor *startColor = [self textColor];; NSColor *endColor = [startColor colorWithAlphaComponent:0.0]; -- cgit v1.2.3