I’d like to get the bounding box of a decomposed layer. To ensure, I don’t decompose the actual layer I’m working on, I copy it into another object. As soon as I do this, the bounding box does not have any width and height any more, even though the copied layer contains paths.
Here is what I tried:
layer = Glyphs.font.selectedLayers[0]
print("layer:",layer)
for path in layer.paths:
print("layer:", path)
print("layer:", layer.bounds)
copiedLayer = layer.copyDecomposedLayer()
print("copied layer:", copiedLayer)
copiedLayer.removeOverlap()
for path in copiedLayer.paths:
print("copied layer:", path)
print("copied layer:", copiedLayer.bounds)
Is this intended behaviour?
I think I can work around this by using the bounding box of the original layer for now, but in other cases this might not be possible.