Rohan210 Rohan210 - 4 months ago 60
Javascript Question

How can I disable scaling points of canvas elements using fabric.js?

By default fabric.js elements come with 8 points to scale any objects. But the app I'm working specifically requires that stretching should not be allowed on a single axis (horizontally or vertically).
I only want the corner points, not the ones on sides.

Is it that possible with fabric.js?

Answer

You can use object.lockUniScaling = true.
Also, you can customize your corners: http://fabricjs.com/customization/

Comments