diff --git a/src/ui/glpatch/glop.js b/src/ui/glpatch/glop.js index ce94ad26a..45a770af8 100644 --- a/src/ui/glpatch/glop.js +++ b/src/ui/glpatch/glop.js @@ -268,10 +268,13 @@ export default class GlOp extends Events if (!this._op || !oldUiAttribs || !oldUiAttribs.translate) return; + let changed = oldUiAttribs.translate.x != this._op.uiAttribs.translate.x || oldUiAttribs.translate.y != this._op.uiAttribs.translate.y; + + // if (this._preDragPosZ != this._glRectBg.z) // this._glRectBg.setPosition(this._glRectBg.x, this._glRectBg.y, this._preDragPosZ); @@ -311,6 +314,7 @@ export default class GlOp extends Events gui.patchView.testCollision(this._op); + undo.endGroup(undoGroup, "Move Ops"); } } diff --git a/src/ui/glpatch/glpatch.js b/src/ui/glpatch/glpatch.js index 088e1bd0c..86a8662c6 100644 --- a/src/ui/glpatch/glpatch.js +++ b/src/ui/glpatch/glpatch.js @@ -572,7 +572,16 @@ export default class GlPatch extends Events const border = 5; this._dropInOpBorder.setSize(this._selectedGlOps[i].w + border * 2, this._selectedGlOps[i].h + border * 2); + + // console.log("dragen2222!!!!!!", this._op.uiAttribs.translate.x, this._glPatch.snap.snapOpX(this._op.uiAttribs.translate.x, this._op)); + + // this._glPatch.patchAPI.setOpUiAttribs(this._id, "translate", { "x": this._glPatch.snap.snapOpX(this._op.uiAttribs.translate.x, this._op), "y": this._glPatch.snap.snapY(this._op.uiAttribs.translate.y) }); + + this._dropInOpBorder.setPosition(this._selectedGlOps[i].x - border, this._selectedGlOps[i].y - border); + + + this._dropInOpBorder.setColor(this._dropInCircleRect.color); this._dropInOpBorder.setOpacity(0.35); } @@ -808,7 +817,16 @@ export default class GlPatch extends Events if (this.selectedGlOps[i].isHovering()) // && this.selectedGlOps[i].isDragging { const coord = this.screenToPatchCoord(e.offsetX, e.offsetY); - gui.patchView.insertOpInLink(this._dropInCircleLink.link, this.selectedGlOps[i].op, Snap.snapOpPosX(coord[0]), Snap.snapOpPosY(coord[1])); + gui.patchView.insertOpInLink(this._dropInCircleLink.link, this.selectedGlOps[i].op, coord[0], coord[1]); + + this._selectedGlOps[i].op.setUiAttribs( + { + "translate": + { + "x": this.snap.snapOpX(this._selectedGlOps[i].op.uiAttribs.translate.x, this._selectedGlOps[i].op, 100), + "y": coord[1] + } }); + return; } }