mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(editor): Address edge toolbar rendering glitches (#10839)
This commit is contained in:
committed by
GitHub
parent
7f4ef31507
commit
e0c0ddee59
@@ -7,7 +7,6 @@ import type {
|
||||
ConnectStartEvent,
|
||||
} from '@/types';
|
||||
import type {
|
||||
EdgeMouseEvent,
|
||||
Connection,
|
||||
XYPosition,
|
||||
ViewportTransform,
|
||||
@@ -31,6 +30,7 @@ import { isPresent } from '@/utils/typesUtils';
|
||||
import { GRID_SIZE } from '@/utils/nodeViewUtils';
|
||||
import { CanvasKey } from '@/constants';
|
||||
import { onKeyDown, onKeyUp } from '@vueuse/core';
|
||||
import CanvasArrowHeadMarker from './elements/edges/CanvasArrowHeadMarker.vue';
|
||||
|
||||
const $style = useCssModule();
|
||||
|
||||
@@ -261,19 +261,7 @@ function onClickConnectionAdd(connection: Connection) {
|
||||
emit('click:connection:add', connection);
|
||||
}
|
||||
|
||||
/**
|
||||
* Connection hover
|
||||
*/
|
||||
|
||||
const hoveredEdges = ref<Record<string, boolean>>({});
|
||||
|
||||
function onMouseEnterEdge(event: EdgeMouseEvent) {
|
||||
hoveredEdges.value[event.edge.id] = true;
|
||||
}
|
||||
|
||||
function onMouseLeaveEdge(event: EdgeMouseEvent) {
|
||||
hoveredEdges.value[event.edge.id] = false;
|
||||
}
|
||||
const arrowHeadMarkerId = ref('custom-arrow-head');
|
||||
|
||||
/**
|
||||
* Executions
|
||||
@@ -511,8 +499,6 @@ provide(CanvasKey, {
|
||||
:selection-key-code="selectionKeyCode"
|
||||
:pan-activation-key-code="panningKeyCode"
|
||||
data-test-id="canvas"
|
||||
@edge-mouse-enter="onMouseEnterEdge"
|
||||
@edge-mouse-leave="onMouseLeaveEdge"
|
||||
@connect-start="onConnectStart"
|
||||
@connect="onConnect"
|
||||
@connect-end="onConnectEnd"
|
||||
@@ -543,8 +529,8 @@ provide(CanvasKey, {
|
||||
<template #edge-canvas-edge="canvasEdgeProps">
|
||||
<Edge
|
||||
v-bind="canvasEdgeProps"
|
||||
:marker-end="`url(#${arrowHeadMarkerId})`"
|
||||
:read-only="readOnly"
|
||||
:hovered="hoveredEdges[canvasEdgeProps.id]"
|
||||
@add="onClickConnectionAdd"
|
||||
@delete="onDeleteConnection"
|
||||
/>
|
||||
@@ -554,6 +540,8 @@ provide(CanvasKey, {
|
||||
<CanvasConnectionLine v-bind="connectionLineProps" />
|
||||
</template>
|
||||
|
||||
<CanvasArrowHeadMarker :id="arrowHeadMarkerId" />
|
||||
|
||||
<Background data-test-id="canvas-background" pattern-color="#aaa" :gap="GRID_SIZE" />
|
||||
|
||||
<Transition name="minimap">
|
||||
|
||||
Reference in New Issue
Block a user