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

Related issues

AbhijitParate picture AbhijitParate  路  3Comments

eugene-g13 picture eugene-g13  路  3Comments

guettli picture guettli  路  4Comments

urcoder picture urcoder  路  5Comments

lyzs90 picture lyzs90  路  3Comments