如何使用fabric.js禁用canvas元素的缩放点? [英] How can I disable scaling points of canvas elements using fabric.js?
本文介绍了如何使用fabric.js禁用canvas元素的缩放点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
默认情况下,fabric.js元素带有8个点来缩放任何对象。但是我工作的应用程序具体要求不应允许在单个轴(水平或垂直)上进行拉伸。
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.
是否可以使用fabric.js?
Is it that possible with fabric.js?
推荐答案
您可以使用 object.lockUniScaling = true
。
此外,您还可以自定义您的角色: http://fabricjs.com/customization/
这篇关于如何使用fabric.js禁用canvas元素的缩放点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文