Re: Redrawing CALayer subclass when super layer is scaled
Re: Redrawing CALayer subclass when super layer is scaled
- Subject: Re: Redrawing CALayer subclass when super layer is scaled
- From: Rick Mann <email@hidden>
- Date: Tue, 15 Jul 2008 22:42:00 -0700
On Jul 9, 2008, at 12:59:33, David Duncan wrote:
A tiled layer will trigger redraws when it detects that higher (or
lower) resolution content is available. It caches this drawing as
well, so you won't get called to redraw just because of a resize of
content at that level is already available.
So, this isn't really working they way I want it to.
I have a canvas, which is my window's root layer. In that I have an
arbitrary number of sublayers. If I set the scaling (via
"transform.scale") of the root layer to x2, everything is redrawn to
double the size (and it smoothly animates up to that scale).
However, at the time that my drawing code is called, the CGContextRef
that's handed to me is NOT scaled. So my drawing is done small, and
then only scaled afterward by some blit operation. The result is very
pixilated lines.
I've tried making my root layer a CATiledLayer, and I've tried making
my individual sublayers CATiledLayers (and setting levels of detail
for both). Nothing works.
I don't really want to have to set the scale on each sublayer; this
seems to defeat the purpose of the drawing transform.
The documentation says that any transform applied to a layer also
applies to its sublayers, but this is not what I'm seeing; at least,
not at draw time.
Any suggestions?
--
Rick
_______________________________________________
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