FROM : Scott Stevenson
DATE : Thu Mar 13 04:08:38 2008
On Mar 12, 2008, at 6:15 PM, Matt James wrote:
> I guess I was thinking from an HTML perspective of adding an image
> within a
> div and how the div grows automatically to contain the image. I can
> understand not clipping, but it seems counter-intuitive that a
> "superlayer"
> can contain something larger than itself and not "grow" in response.
It probably has something to do with the fact that CSS was designed
for page layout and Cocoa and Core Animation were designed for
application user interfaces. Also, Core Animation has different
considerations for OpenGL text size limits.
FWIW, child divs can also exist outside of their parents in some
cases, such as when you use negative margins or if you apply a float
attribute on the child. But that's probably nitpicking. :)
If you do want a parent CALayer to clip the sublayers, you can do this:
superLayer.masksToBounds = YES;
This also clips out the shadows, though.
- Scott
DATE : Thu Mar 13 04:08:38 2008
On Mar 12, 2008, at 6:15 PM, Matt James wrote:
> I guess I was thinking from an HTML perspective of adding an image
> within a
> div and how the div grows automatically to contain the image. I can
> understand not clipping, but it seems counter-intuitive that a
> "superlayer"
> can contain something larger than itself and not "grow" in response.
It probably has something to do with the fact that CSS was designed
for page layout and Cocoa and Core Animation were designed for
application user interfaces. Also, Core Animation has different
considerations for OpenGL text size limits.
FWIW, child divs can also exist outside of their parents in some
cases, such as when you use negative margins or if you apply a float
attribute on the child. But that's probably nitpicking. :)
If you do want a parent CALayer to clip the sublayers, you can do this:
superLayer.masksToBounds = YES;
This also clips out the shadows, though.
- Scott
| Related mails | Author | Date |
|---|---|---|
| Matt James | Mar 11, 17:18 | |
| Scott Stevenson | Mar 11, 23:25 | |
| Matt James | Mar 12, 02:34 | |
| Scott Stevenson | Mar 12, 06:07 | |
| Matt James | Mar 12, 12:56 | |
| Matt James | Mar 12, 13:06 | |
| Scott Stevenson | Mar 12, 23:15 | |
| Matt James | Mar 13, 02:15 | |
| Scott Stevenson | Mar 13, 04:08 | |
| Scott Stevenson | Mar 13, 04:11 |






Cocoa mail archive

