Hello @Alexander_Hexemer, responded on the GIthub issue but maybe that could help others:
Under the hood, json_data
is a FabricJS object exported in JSON with .toObject
.
It seems for a scaled object, you will need to apply the scaleX
/scaleY
factor to the height
/width
to retrieve the correct values. FabricJS preserves the original dimensions and applies a ratio independently.
st.text(f"Scaled height: {dic['height'] * dic['scaleY']}")
st.text(f"Scaled width: {dic['width'] * dic['scaleX']}")
doesn’t seem like rotating the rectangle adds more complexity .