From e1c63e47994b4eee84f8e44384550e0f826ad6e9 Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Wed, 13 Apr 2022 17:26:20 +0300 Subject: [PATCH] :sparkles: Added snapping to grid. Changed how draggable ghost follows the cursor. --- .../components/NodeCreator/ItemIterator.vue | 2 +- .../src/components/NodeCreator/MainPanel.vue | 27 ++++--- .../components/NodeCreator/NodeCreator.vue | 2 +- .../src/components/NodeCreator/NodeItem.vue | 81 +++++++++++++++---- .../NodeCreator/SubcategoryPanel.vue | 7 +- packages/editor-ui/src/views/NodeView.vue | 2 + 6 files changed, 90 insertions(+), 31 deletions(-) diff --git a/packages/editor-ui/src/components/NodeCreator/ItemIterator.vue b/packages/editor-ui/src/components/NodeCreator/ItemIterator.vue index c574ec9a1b84cc..e07b5fed687ec8 100644 --- a/packages/editor-ui/src/components/NodeCreator/ItemIterator.vue +++ b/packages/editor-ui/src/components/NodeCreator/ItemIterator.vue @@ -21,7 +21,7 @@ :lastNode=" index === elements.length - 1 || elements[index + 1].type !== 'node' " - @click="emit('selected', item, $event)" + @click="$emit('selected', item)" @dragstart="emit('dragstart', item, $event)" @dragend="emit('dragend', item, $event)" /> diff --git a/packages/editor-ui/src/components/NodeCreator/MainPanel.vue b/packages/editor-ui/src/components/NodeCreator/MainPanel.vue index b06a35f0bdca33..d0ad6c7b8777bf 100644 --- a/packages/editor-ui/src/components/NodeCreator/MainPanel.vue +++ b/packages/editor-ui/src/components/NodeCreator/MainPanel.vue @@ -1,7 +1,16 @@