Skip to content

Instantly share code, notes, and snippets.

@gorenje
Created March 22, 2011 13:44
Show Gist options
  • Save gorenje/881221 to your computer and use it in GitHub Desktop.
Save gorenje/881221 to your computer and use it in GitHub Desktop.
workaround for #1183
/**************************
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