Fabric.js: index of an objects

Created on 20 Oct 2011  路  1Comment  路  Source: fabricjs/fabric.js

how to get the current selected object INDEX from the total number of object in canvas?

For example I have 5 rectangles. If I select a rectangle and click a button it should display the current Index of the object

Most helpful comment

myCanvas.getObjects().indexOf(myObject)

>All comments

myCanvas.getObjects().indexOf(myObject)

Was this page helpful?
0 / 5 - 0 ratings