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

mikebronner picture mikebronner  路  47Comments

kangax picture kangax  路  39Comments

jonathan-roy picture jonathan-roy  路  35Comments

Reggino picture Reggino  路  42Comments

ajck picture ajck  路  56Comments