Re: CALayer and View Scaling

2008-06-29 Thread Scott Anguish


On Jun 29, 2008, at 11:25 PM, Gordon Apple wrote:

   BTW, I tried unsuccessfully to observe the clip view's bounds to  
trigger
code to resize the CALayers.  Why can't I observe it?  I finally set  
an

observer on the scale factor in SKTZoomingScrollView.



because the bounds value of views are not KVO compliant.

unless KVO compliance is specifically noted in the reference, don't  
count on it.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: CALayer and View Scaling

2008-06-29 Thread Graham Cox
I'm not familiar with SKTZoomingScrollView but I do wonder why its  
author wrote it that way, when to get zooming you can simply use the  
actual view's -scaleUnitSquareToSize: method (plus frame computation),  
and any enclosing clipview/scrollview does the right thing without any  
work at all. I thought that was the supported way to implement  
zooming, so maybe CALayer will work when zooming is done that way.


If there's some good reason NOT to use -scaleUnitSquareToSize: I'd  
like to hear it because that's what I've been using since 10.2 and  
have had no problem with it.


I have a general-purpose view class here that wraps up this zoom  
functionality. Might we worth trying with CALayer...


http://apptree.net/gczoomview.htm


cheers, Graham


On 30 Jun 2008, at 1:25 pm, Gordon Apple wrote:

   Apparently, there is a disconnect between the view's coordinate  
system

context and that of the contained CALayers.  I'm using Sketch's
SKTZoomingScrollView to set the scale factor of my main drawing  
view.  It
works great without CALayers.  What is does is it scales the bounds  
of the
containing NSClipView, which automatically scales my main view.   
However,

the CALayers don't scale when they draw in the view.

   BTW, I tried unsuccessfully to observe the clip view's bounds to  
trigger
code to resize the CALayers.  Why can't I observe it?  I finally set  
an

observer on the scale factor in SKTZoomingScrollView.

   What is the best way to make the CALayers track my main view?   
The main
view is not really changed except for the fact that it is embedded  
in the

clip view which has rescaled its bounds.  Apparently, scaling the view
coordinates does not propagate down to the CALayers.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/graham.cox%40bigpond.com

This email sent to [EMAIL PROTECTED]


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]