0

I have tried somthing like this in draw2dTouch:

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

but the behaviour is not expected as it should be. So please check if this is the library bug due to new release. Because I think in previous version it is not like that.

Thanks in advance.Please help me in it I am stuck in it.

JS Rocker
  • 148
  • 1
  • 1
  • 10

1 Answers1

0

I also had the problem.

It seems to be a bug. I added this line "this.mouseDownElement = figure;" to SingleSelectionPolicy.js as below to fix the problem.

    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();
        }
    }
Pierre
  • 1,607
  • 3
  • 21
  • 33