Hello!
I need to scale image to sertain width and height manually, not by using controls.
But
Scales an object to a given height/width, with respect to bounding box (scaling by x/y equally)
.
Is it possible to scale by one side only?
Not sure but maybe this can help you?
scaleX :Number
Object scale factor (horizontal)
http://fabricjs.com/docs/fabric.Object.html
Thanks for help willKo. I really can scale by one side! But i need to scale to sertain width or height.
This question would be better on stackoverflow, but you can do it like this:
object.set('scaleX', desiredWidth / object.width)
Most helpful comment
This question would be better on stackoverflow, but you can do it like this: