| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Mar 18, 2008, at 2:45 am, Neil Clayton wrote: I'm wanting to draw a polygon around a layer. I want the polygon to be 1 pixel wide regardless of the transformations applied to the layer. As such a border/borderWidth solution won't work because it'll be scaled if the layer is scaled. So I've computed the scaled and rotated coordinates of said layer by walking up the layer tree and applying the affine transforms top-down to each of the four points making up the original rectangle of the layer. This gives me what I want - until I do rotation with sublayerTransforms. Can't you achieve this by using the convertPoint: from/toLayer: methods on CALayer to map the corner points of your target layer to the coordinate space of some superlayer, rather than doing all the matrix math yourself? The convertRect:to/FromLayer: methods may be ever simpler, if you just need to know the final bounding box. Simon |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartz-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartz-dev/email@hidden This email sent to email@hidden
| References: | |
| >Working out the four points of a sublayerTransform (From: Neil Clayton <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.