From fb5857c1982784f491da4ca4958c061ab49826f9 Mon Sep 17 00:00:00 2001 From: unimu-cc Date: Tue, 28 Nov 2023 13:18:03 +0800 Subject: [PATCH] fix: alignment issue #88 #89 --- .../SeqDiagram/MessageLayer/Block/Block.vue | 35 +++++++---- .../Statement/Interaction/Interaction.vue | 14 +++-- .../Interaction/Occurrence/Occurrence.vue | 53 +++++++++------- .../Block/Statement/Statement.vue | 62 +++++++++++-------- .../SeqDiagram/MessageLayer/MessageLayer.vue | 27 ++++++++ src/parser/IsInitedFromOccurrence.js | 4 +- 6 files changed, 129 insertions(+), 66 deletions(-) diff --git a/src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Block.vue b/src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Block.vue index 0c1026888..50ac09b53 100644 --- a/src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Block.vue +++ b/src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Block.vue @@ -1,28 +1,41 @@ diff --git a/src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Statement/Interaction/Interaction.vue b/src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Statement/Interaction/Interaction.vue index 072e39ced..199adb6a9 100644 --- a/src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Statement/Interaction/Interaction.vue +++ b/src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Statement/Interaction/Interaction.vue @@ -8,7 +8,7 @@ :class="{ highlight: isCurrent, self: isSelf, - 'inited-from-occurrence': isInitedFromOccurrence, + 'inited-from-occurrence': inheritFromOccurrence, 'right-to-left': rightToLeft, }" :style="{ @@ -64,12 +64,18 @@ import Occurrence from "./Occurrence/Occurrence.vue"; import Message from "../Message/Message.vue"; import { mapGetters } from "vuex"; import SelfInvocation from "./SelfInvocation/SelfInvocation.vue"; -import { CodeRange } from "../../../../../../../parser/CodeRange"; -import { ProgContext } from "../../../../../../../parser"; +import { CodeRange } from "@/parser/CodeRange"; +import { ProgContext } from "@/parser"; export default { name: "interaction", - props: ["context", "selfCallIndent", "commentObj", "number"], + props: [ + "context", + "selfCallIndent", + "commentObj", + "number", + "inheritFromOccurrence", + ], computed: { // add tracker to the mapGetters ...mapGetters(["participants", "distance2", "cursor", "onElementClick"]), diff --git a/src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Statement/Interaction/Occurrence/Occurrence.vue b/src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Statement/Interaction/Occurrence/Occurrence.vue index 5821badb9..319ecb1e5 100644 --- a/src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Statement/Interaction/Occurrence/Occurrence.vue +++ b/src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Statement/Interaction/Occurrence/Occurrence.vue @@ -7,24 +7,29 @@ :data-x-offset="center" :data-debug-center-of="computedCenter" > - + @@ -91,7 +96,11 @@ export default { transform: translateY(1px); } -:deep(> .statement-container:last-child > .interaction.return:last-of-type > .message) { +:deep( + > .statement-container:last-child + > .interaction.return:last-of-type + > .message + ) { bottom: -17px; /* Move the absolutely positioned return message to the bottom. -17 to offset the padding of Occurrence. */ height: 0; } diff --git a/src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Statement/Statement.vue b/src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Statement/Statement.vue index c63420c5c..71a36065a 100644 --- a/src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Statement/Statement.vue +++ b/src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Statement/Statement.vue @@ -3,58 +3,66 @@ Set text color to text-skin-base for all messages and allow fragments to override it. -->