以下是撤消/重做的示例:Undo_Redo_Delete
我做了以下步骤:
TypeError:this.parent.getCanvas()为null
在port.js的this.parent.getCanvas()。connectionLine.setGlow(false)中。
如果有人知道如何克服这个问题,那么请帮帮我。谢谢你提前:)
答案 0 :(得分:1)
已修复版本0.9.38
如果需要快速修复,可以使用以下代码替换onDragEnd方法。
/**
* @inheritdoc
**/
onDragEnd:function()
{
this.parent.getCanvas().setSnapToGrid(this.originalSnapToGrid );
this.parent.getCanvas().setSnapToGeometry( this.originalSnapToGeometry );
// Don't call the parent implementation. This will create an CommandMove object
// and store them o the CommandStack for the undo operation. This makes no sense for a
// port.
// graphiti.shape.basic.Rectangle.prototype.onDragEnd.call(this); DON'T call the super implementation!!!
this.setAlpha(1.0);
// 1.) Restore the old Position of the node
//
this.setPosition(this.ox,this.oy);
// 2.) Remove the bounding line from the canvas
//
this.parent.getCanvas().hideConnectionLine();
this.isInDragDrop =false;
// Reset the drag&drop flyover information
//
this.currentTarget = null; // <<== this is the missing line to fix the bug
},