Fabric.js: Bounding rectangle is not updated after setLeft/setRight

Created on 29 Mar 2013  路  4Comments  路  Source: fabricjs/fabric.js

When moving the object from javascript using setLeft/setRight (followed by a canvas.renderAll()), the object itself moves but the bounding rectangle stays still.
I wasn't able to find any function to force updating bounding rectangle after a move either, so I believe this is a bug. It happens with a single selected object as well as a group of objects.

bug

Most helpful comment

Calling setCoords() method fixed the problem. Maybe this should be documented.

All 4 comments

Calling setCoords() method fixed the problem. Maybe this should be documented.

old issue, but I'm experiencing the same bug in ver 2.6.0.
after moving objects within a multiple selected with set('left', x), the bounding box doesn't update to the new position

No it doesn't.
You have to call setCoords since you are setting left, you should do it.

Of course, forgot to mention that this is happening even after calling setCoords() on every object in the selection

Was this page helpful?
0 / 5 - 0 ratings

Related issues

semiadam picture semiadam  路  3Comments

bhaskardas9475 picture bhaskardas9475  路  4Comments

gjijon picture gjijon  路  5Comments

urcoder picture urcoder  路  5Comments

medialwerk picture medialwerk  路  5Comments