diff --git a/spx-gui/src/components/editor/preview/stage-viewer/StageViewer.vue b/spx-gui/src/components/editor/preview/stage-viewer/StageViewer.vue index dc18737f7..9759a9782 100644 --- a/spx-gui/src/components/editor/preview/stage-viewer/StageViewer.vue +++ b/spx-gui/src/components/editor/preview/stage-viewer/StageViewer.vue @@ -47,6 +47,7 @@ import { useEditorCtx } from '../../EditorContextProvider.vue' import SpriteTransformer from './SpriteTransformer.vue' import SpriteItem from './SpriteItem.vue' import { MapMode } from '@/models/stage' +import Konva from 'konva' const editorCtx = useEditorCtx() const conatiner = ref(null) @@ -158,6 +159,12 @@ const menuPos = ref({ x: 0, y: 0 }) function handleContextMenu(e: KonvaEventObject) { e.evt.preventDefault() + + // Ignore right click on backdrop. + // Konva.Rect is a subclass of Konva.Shape. + // Currently we have all sprites as Konva.Shape and backdrop as Konva.Rect. + if (e.target instanceof Konva.Rect) return + if (stageRef.value == null || e.target.parent == null) return const stage: Stage = stageRef.value.getStage() const pointerPos = stage.getPointerPosition()