I have a custom CALayer hosted in an NSView, contained in an NSScrollView, setting properties on the CALayer will cause it's bounds to change.
The problem is that the NSView really wants to own the bounds of the contained CALayer, I can make it work by adding a KVO on the bounds so when the layer bounds changes it changes the NSView bounds (which changes the layer bounds to the same value - luckily KVO doesn't recurse if the value doesn't actually change).
Is there a better way? It would seem like going through the layout system would be better but then I can only specify my preferred frame (my bounds through my transform) - and this turns into setting my bounds, but with some amount of roundoff error.
How should a CALayer request a bounds change? Or is my current hack the preferred mechanism...