mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-21 06:05:45 +08:00
Comment now drag nodes
This commit is contained in:
@@ -45,6 +45,7 @@ export default class Paste extends IInput {
|
||||
if (nodes.length > 0) {
|
||||
this.blueprint.unselectAll()
|
||||
}
|
||||
this.blueprint.addGraphElement(...nodes)
|
||||
let mousePosition = this.blueprint.mousePosition
|
||||
nodes.forEach(node => {
|
||||
const locationOffset = [
|
||||
@@ -55,7 +56,6 @@ export default class Paste extends IInput {
|
||||
node.snapToGrid()
|
||||
node.setSelected(true)
|
||||
})
|
||||
this.blueprint.addGraphElement(...nodes)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,11 @@ import MouseMoveDraggable from "./MouseMoveDraggable"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../Blueprint").default} Blueprint
|
||||
* @typedef {import("../../element/ISelectableDraggableElement").default} ISelectableDraggableElement
|
||||
* @typedef {import("../../element/NodeElement").default} NodeElement
|
||||
* @typedef {import("../../template/CommentNodeTemplate").default} CommentNodeTemplate
|
||||
*/
|
||||
|
||||
/** @extends {MouseMoveDraggable<ISelectableDraggableElement>} */
|
||||
/** @extends {MouseMoveDraggable<NodeElement>} */
|
||||
export default class MouseMoveNodes extends MouseMoveDraggable {
|
||||
|
||||
startDrag() {
|
||||
@@ -23,6 +24,15 @@ export default class MouseMoveNodes extends MouseMoveDraggable {
|
||||
if (!this.started) {
|
||||
this.blueprint.unselectAll()
|
||||
this.target.setSelected(true)
|
||||
} else {
|
||||
this.blueprint.getNodes(true).forEach(node =>
|
||||
node.boundComments
|
||||
.filter(comment => !node.isInsideComment(comment))
|
||||
.forEach(comment => node.unbindFromComment(comment))
|
||||
)
|
||||
this.blueprint.getCommentNodes(true).forEach(comment =>
|
||||
/** @type {CommentNodeTemplate} */(comment.template).manageNodesBind()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user