fix(editor): Add striped background to readonly canvas (no-changelog) (#11297)

This commit is contained in:
Raúl Gómez Morales
2024-10-18 09:26:13 +02:00
committed by GitHub
parent 8e5292cf6c
commit a13e142ee2
3 changed files with 56 additions and 1 deletions

View File

@@ -32,6 +32,7 @@ import { CanvasKey } from '@/constants';
import { onKeyDown, onKeyUp, useDebounceFn } from '@vueuse/core';
import CanvasArrowHeadMarker from './elements/edges/CanvasArrowHeadMarker.vue';
import { CanvasNodeRenderType } from '@/types';
import CanvasBackgroundStripedPattern from './elements/CanvasBackgroundStripedPattern.vue';
const $style = useCssModule();
@@ -110,6 +111,7 @@ const {
onPaneReady,
findNode,
onNodesInitialized,
viewport,
} = useVueFlow({ id: props.id, deleteKeyCode: null });
const isPaneReady = ref(false);
@@ -562,7 +564,11 @@ provide(CanvasKey, {
<CanvasArrowHeadMarker :id="arrowHeadMarkerId" />
<Background data-test-id="canvas-background" pattern-color="#aaa" :gap="GRID_SIZE" />
<Background data-test-id="canvas-background" pattern-color="#aaa" :gap="GRID_SIZE">
<template v-if="readOnly" #pattern-container>
<CanvasBackgroundStripedPattern :x="viewport.x" :y="viewport.y" :zoom="viewport.zoom" />
</template>
</Background>
<Transition name="minimap">
<MiniMap