问题描述
标题说明了一切.当fabric.IText
是fabric.Group
的一部分时,它不再像可编辑的文本那样反应.
The title says all. When a fabric.IText
is part of a fabric.Group
, it no longer reacts like a editable text.
这是一个用例: http://jsfiddle.net/vAjYd/
有没有办法解决这个问题?否则,我必须在群组上写我的内容.
Is there a way to solve this problem? Otherwise I have to write my on group.
Btw:fabric.Group
具有许多优点,但是禁用的事件使其无法用于UI元素(即,该用例或成组的文本和矩形按钮组).
Btw: A fabric.Group
has many advantages, but the disabled eventing makes it impossible to use for UI-Elements (i.e. this use-case or groups of buttons as groups of texts and rects).
推荐答案
当前,IText无法处理事件,因为如果它们包含在组中,则它们不会传递给事件.我认为这也是处理该问题的首选方法,因为这会使用户感到困惑-如果他开始编辑多个文本该怎么办.这可能会变得一团糟.也许您可以稍微修改一下脚本来解决此问题.
Currently there is no way for IText to handle the events as they are not handed down to it if it's contained in a group. I think this is also the prefered way to handle that as it would confuse the user - what if he starts to edit multiple texts. This might end up in a mess. Maybe you can rework your script a little to workaround this problems.
这篇关于Fabric.js-分组的iText不可编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!