Lukasz Balcerzak avatar Lukasz Balcerzak committed a283974

Fixed blank pixels problem with CGLayer

Comments (0)

Files changed (2)

AnimationArtifacts.xcodeproj/project.pbxproj

 	objects = {
 
 /* Begin PBXBuildFile section */
+		B213B22716495CE6000CD37B /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B213B22616495CE6000CD37B /* QuartzCore.framework */; };
 		B294DF0F1646CBC3005CF708 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B294DF0E1646CBC3005CF708 /* Cocoa.framework */; };
 		B294DF191646CBC3005CF708 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = B294DF171646CBC3005CF708 /* InfoPlist.strings */; };
 		B294DF1B1646CBC3005CF708 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B294DF1A1646CBC3005CF708 /* main.m */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
+		B213B22616495CE6000CD37B /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
 		B294DF0A1646CBC3005CF708 /* AnimationArtifacts.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AnimationArtifacts.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		B294DF0E1646CBC3005CF708 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
 		B294DF111646CBC3005CF708 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				B213B22716495CE6000CD37B /* QuartzCore.framework in Frameworks */,
 				B294DF0F1646CBC3005CF708 /* Cocoa.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		B294DF0D1646CBC3005CF708 /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
+				B213B22616495CE6000CD37B /* QuartzCore.framework */,
 				B294DF0E1646CBC3005CF708 /* Cocoa.framework */,
 				B294DF101646CBC3005CF708 /* Other Frameworks */,
 			);
 				B294DF2A1646CBC3005CF708 /* Release */,
 			);
 			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
 		};
 /* End XCConfigurationList section */
 	};

AnimationArtifacts/RoundedView.m

 //
 
 #import "RoundedView.h"
-
+#import <QuartzCore/QuartzCore.h>
 #define RADIUS 5.0
 
 @implementation RoundedView
     return self;
 }
 
-- (void)drawRect:(NSRect)rect
+- (void)awakeFromNib
 {
-    NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:RADIUS yRadius:RADIUS];
-    [[NSColor blackColor] set];
-    [path fill];
+    self.wantsLayer = YES;
+    self.layer = [CALayer layer];
+    self.layer.backgroundColor = [[NSColor blackColor] CGColor];
+    self.layer.cornerRadius = RADIUS;
 }
 
 @end
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.