Getting width/height properties off Ellipse object

I cannot get the height and width properties off objects other than Rectangles. Am I missing something here?

const runImages = async (selection) => {
  for(let i = 0; i < selection.items.length; i++) {
    let {constructor, width, height} = selection.items[i];
    console.log(constructor.name, `width: ${width} | height: ${height} `)
  }
}

If the selected object is Rectangle then
output //
Rectangle width: 916 | height: 571

However, if the object is Ellipse then the
output //

Ellipse width: undefined | height: undefined

TIA!

Only Rectangles have width and height properties.

For all SceneNode superclasses (including Rectangles), you can use .localBounds.width and .localBounds.height instead.

2 Likes

YES! Thank you so much.