0

Undo/Redo の例を次に示します。Undo_Redo_Delete

次の手順を実行しました。

  1. 開始ノードと終了ノードをドラッグ アンド ドロップします。
  2. ポート経由で接続します。
  3. 終了ノードを削除します。
  4. ここで再び終了ノードをドラッグします。
  5. 今回は、開始ノードと終了ノードを再度接続しようとしましたが、表示されます

TypeError: this.parent.getCanvas() が null です

port.js の this.parent.getCanvas().connectionLine.setGlow(false) で。

この問題を克服する方法を知っている人がいる場合は、私を助けてください。よろしくお願いします:)

4

1 に答える 1

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
},
于 2012-08-20T16:34:22.110 に答える