Created
March 22, 2011 13:44
-
-
Save gorenje/881221 to your computer and use it in GitHub Desktop.
workaround for #1183
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************** | |
c_a_layer_fixed.j | |
**************************/ | |
@implementation CALayerFixed : CALayer | |
- (void)composite | |
{ | |
var originalTransform = CGAffineTransformCreateCopy(_transformFromLayer); | |
[super composite]; | |
_transformFromLayer = originalTransform; | |
} | |
@end | |
/************************** | |
Then in AppController.j | |
**************************/ | |
@import <Foundation/CPObject.j> | |
@import <AppKit/CPCookie.j> | |
@import <AppKit/CPView.j> | |
@import "c_a_layer_fixed.j" | |
/************************* | |
Using CALayerFixed | |
*************************/ | |
@implementation MyDrawingView : CPView | |
{ | |
CALayer m_rootLayer; | |
} | |
- (id)initWithFrame:(CGRect)aFrame | |
{ | |
self = [super initWithFrame:aFrame]; | |
if ( self ) { | |
m_rootLayer = [CALayerFixed layer]; | |
[m_rootLayer setDelegate:self]; | |
[self setWantsLayer:YES]; | |
[self setLayer:m_rootLayer]; | |
} | |
return self; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment