From b432655e7f9f6f295fa6ee29137e8faf26d3c2c8 Mon Sep 17 00:00:00 2001 From: Adam Obuchowicz Date: Thu, 4 Jul 2024 12:03:07 +0200 Subject: [PATCH 1/2] Add node button is above port --- .../src/components/GraphEditor/GraphNode.vue | 17 +++++++++++++++-- .../src/components/VisualizationContainer.vue | 12 ------------ package-lock.json | 18 +----------------- 3 files changed, 16 insertions(+), 31 deletions(-) diff --git a/app/gui2/src/components/GraphEditor/GraphNode.vue b/app/gui2/src/components/GraphEditor/GraphNode.vue index 29e7e69e268b..ec5504a93c7c 100644 --- a/app/gui2/src/components/GraphEditor/GraphNode.vue +++ b/app/gui2/src/components/GraphEditor/GraphNode.vue @@ -16,6 +16,7 @@ import NodeWidgetTree, { GRAB_HANDLE_X_MARGIN_R, ICON_WIDTH, } from '@/components/GraphEditor/NodeWidgetTree.vue' +import SmallPlusButton from '@/components/SmallPlusButton.vue' import SvgIcon from '@/components/SvgIcon.vue' import { useDoubleClick } from '@/composables/doubleClick' import { usePointer, useResizeObserver } from '@/composables/events' @@ -242,11 +243,9 @@ const isVisualizationFullscreen = computed(() => props.node.vis?.fullscreen ?? f const bgStyleVariables = computed(() => { const { x: width, y: height } = nodeSize.value - const visBelowNode = graphSelectionSize.value.y - nodeSize.value.y return { '--node-width': `${width}px`, '--node-height': `${height}px`, - '--output-port-transform': `translateY(${visBelowNode}px)`, } }) @@ -423,6 +422,7 @@ watchEffect(() => { minWidth: isVisualizationEnabled ? `${visualizationWidth ?? 200}px` : undefined, '--node-group-color': color, ...(node.zIndex ? { 'z-index': node.zIndex } : {}), + '--viz-below-node': `${graphSelectionSize.y - nodeSize.y}px`, }" :class="{ selected, @@ -549,6 +549,11 @@ watchEffect(() => { @update:nodeHovered="outputHovered = $event" /> + @@ -562,6 +567,7 @@ watchEffect(() => { left: 0; display: flex; + --output-port-transform: translateY(var(--viz-below-node)); --output-port-max-width: 4px; --output-port-hovered-extra-width: 2px; --output-port-overlap: -8px; @@ -698,4 +704,11 @@ watchEffect(() => { .dragged { cursor: grabbing !important; } + +.below-viz { + position: absolute; + top: 100%; + transform: translateY(var(--viz-below-node)); + margin-top: 4px; +} diff --git a/app/gui2/src/components/VisualizationContainer.vue b/app/gui2/src/components/VisualizationContainer.vue index bab67b0d07af..8df8ed10df19 100644 --- a/app/gui2/src/components/VisualizationContainer.vue +++ b/app/gui2/src/components/VisualizationContainer.vue @@ -1,6 +1,5 @@