… when applying .copyDecomposedLayer()
on the layer? It seems that the origin.x (for example) is at the top right when the layer has a rotated component. Is this on purpose? If so, what’s the best (easiest on CPU) method to re-rotate the bounding box? Checking for the component’s transform and negatively apply it? Low priority … just wondering
Edit:
I made a little Skedge sketch, but there it seems to be as normally expected, the origin x at bottom left. So I need to investigate what’s happening there in my plugin …
# Run in Skedge with a component glyph active:
from AppKit import NSRectFill, NSColor, NSRect
def badge(x, y, s):
global NSRectFill, NSColor, NSRect
rect = NSRect( (x-s/2, y-s/2), (s, s) )
NSColor.greenColor().set()
NSRectFill(rect)
bounds = layer.copyDecomposedLayer().bounds
badge(bounds.origin.x, bounds.origin.y, 50 )
Edit 2:
Solved. I had a .copy()
in front of the .copyDecomposedLayer()
(I wanted to be super sure) and that messed it up.