Bug? layer.copyDecomposedLayer() returns layer with 0 dimentional bounds

layer = Font.selectedLayers[0]
decLayer = layer.copyDecomposedLayer()
print(decLayer.bounds)  # origin 0,0 | size 0,0
print(layer.bounds)

as in topic: layer.copyDecomposedLayer() returns decomposed layer with 0 dimentional bounds.
I guess, it could be a matter of returned layer that is orphaned. It’s bounds returns 0,0 position with 0,0 size which isn’t true.
I need that orphaned layer to collect some data among which I would like to get actual dimentions of the shapes I have.

A layer needs a parent to compute the bounds. A decomposed layer might be fine without it, but I rather have a consistent behavior instead of a failure in some cases.

Why don’t you get the bounds from the original layer?

I’m making code that is compatible with both fontparts and glyphs API. It is less messy in my use to do it with an abstract layer.

Nevermind then, I will use fonttool’s BoundsPen to make it work as intended

No need to use boundsPen. Just do copy.parent = orig.parent before you get the bounds. But still, why making the copy in the first place?

And what fontParts implementation are you working with?

No need to use boundsPen. Just do copy.parent = orig.parent before you get the bounds. But still, why making the copy in the first place?

Thanks!
Longer topic: it is connected to the methods of the private library, that I want to use for both RF and G3. There is no nice way to use an original layer.

And what fontParts implementation are you working with?

RoboFont’s implementation.