Re: Disable implicit animations in layer backed NSScrollViews?
Re: Disable implicit animations in layer backed NSScrollViews?
- Subject: Re: Disable implicit animations in layer backed NSScrollViews?
- From: Kyle Sluder <email@hidden>
- Date: Sun, 24 Jul 2011 22:29:48 -0700
On Sun, Jul 24, 2011 at 10:00 PM, Daniel Waylonis <email@hidden> wrote:
> Hi Kyle,
> If you're back from vacation, could you describe how things were fixed in
> OmniPlan?
I've got a blog post in the editing phase describing all the things we
do to get NSScrollViews working, but the only other thing we do that I
can think of is to swizzle -[NSClipView scrollToPoint:] to look like
the following:
- (void)scrollToPoint:(NSPoint)newOrigin {
originalScrollToPoint(self, _cmd, newOrigin);
[self fixLayerGeometry];
[[self subviews] makeObjectsPerformSelector:@selector(fixLayerGeometry)];
}
-[NSView(LayerBackedFix) fixLayerGeometry] is defined like this:
- (void)fixLayerGeometry {
if (![self layer])
return;
[CATransaction begin];
[CATransaction setDisableActions:YES];
for (NSView *subview in [self subviews]) {
CALayer *layer = [subview layer];
CGPoint layerPosition = NSPointToCGPoint([self
convertPointToBase:[subview frame].origin]); // note: on Lion, we want
to use -convertPointToBacking: instead.
layer.position = layerPosition;
}
[CATransaction commit];
}
Pay attention to that note, since on Lion base coordinate systems
don't mean the same thing as backing coordinate systems.
I'm going to CC this to the list, since it's helpful information.
Hope that helps!
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden