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

前端 未结 5 1681
臣服心动
臣服心动 2021-02-12 11:17

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 (hor

5条回答
  •  一个人的身影
    2021-02-12 11:55

    By default you can't make it. But you can create some functions like : if width = x then height = y with some relation between x and y on some event(like "on:scaling"), you can always make the width and height to be in certain ratio.

提交回复
热议问题