【问题标题】:Resizeable but not draggable in draw2dTouch在draw2d Touch中可调整大小但不可拖动
【发布时间】:2013-02-12 10:43:57
【问题描述】:

我在 draw2dTouch 中尝试过这样的事情:

this.setSelectable(true);
this.setDraggable(false);
this.setResizeable(true);

但该行为并非预期的那样。所以请检查这是否是由于新版本引起的库错误。因为我觉得以前的版本不是这样的。

在此先感谢。请帮助我,我陷入困境。

【问题讨论】:

    标签: javascript graphiti-js draw2d-js


    【解决方案1】:

    我也有这个问题。

    这似乎是一个错误。我添加了这一行“this.mouseDownElement = figure;”到 SingleSelectionPolicy.js 如下解决问题。

        if (figure !== canvas.getSelection().getPrimary() && figure !== null && figure.isSelectable() === true) {
            this.select(canvas,figure);
    
            // its a line
            if (figure instanceof draw2d.shape.basic.Line) {
                if (!(figure instanceof draw2d.Connection)) {
                    canvas.draggingLineCommand = figure.createCommand(new draw2d.command.CommandType(draw2d.command.CommandType.MOVE));
                    if (canvas.draggingLineCommand !== null) {
                        canvas.draggingLine = figure;
                    }
                }
    
                //added to fix Draw2D draggable = false bug
                this.mouseDownElement = figure;
            }
            else if (canDragStart === false) {
                figure.unselect();
            }
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-06
      • 2014-01-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多