简体   繁体   English

防止在fabricjs中单击并拖动多项选择

[英]prevent click and drag multi selection in fabricjs

How can I disable the click-drag multi selection in fabricjs? 如何禁用fabric.js中的单击拖动多个选择?

In this image you can see the selection area with a red border: 在此图像中,您可以看到带有红色边框的选择区域:

http://imgur.com/mE0jIlx http://imgur.com/mE0jIlx

I want to prevent that kind of selection, but still allow single object selections. 我想避免这种选择,但仍然允许单个对象选择。

There is a property on fabric.Canvas objects called selection which controls this group-selection behavior. fabric.Canvas对象上有一个属性,称为selection ,它控制此组选择行为。

var canvas = new fabric.Canvas('c', {width: 500, height: 500, selection: false});

//Or quite simply:
canvas.selection = false;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM