I'm trying to set fabric up so the origin is bottom left instead of top left. Currently I'm using setViewportTransform
and it transforms everything as I want, except for the selection box. (doesn't seem to get the transformation) I made a fiddle & you can see how if you rotate the rectangle, the selection box rotates the wrong way.
So my question is, how do I set fabric.js' origin to the bottom left?
The simplest solution I found was to:
transform: scaleY(-1)
to the canvas CSS fabric.Canvas.prototype.getPointer
but replace pointer.y = pointer.y - this._offset.top
with pointer.y = bounds.height - pointer.y + this._offset.top
** Fabric version 1.7.20
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.