Skip to content

Commit 83f2db4

Browse files
authored
Merge pull request #164 from mermaid-js/fix/self-sync-message-at-root
Fix/self sync message at root
2 parents 169d125 + a753dfe commit 83f2db4

File tree

8 files changed

+13
-14
lines changed

8 files changed

+13
-14
lines changed

cy/self-sync-message-at-root.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414
<body>
1515
<div id="diagram" class="diagram">
1616
<pre class="zenuml" style="margin: 0">
17-
@Starter(A)
18-
new B()
17+
selfSync() {
18+
A.method {
19+
B.method
20+
}
21+
}
1922
</pre>
2023
</div>
2124

cy/smoke.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<body>
1515
<div id="diagram" class="diagram">
1616
<pre class="zenuml" style="margin: 0">
17-
1817
title ABCD Title
1918
// Generating Sequence Diagrams from Java code is experimental.
2019
// Please report errors to https://github.com/ZenUml/jetbrains-zenuml/discussions
@@ -32,7 +31,6 @@
3231
}
3332
return "resultStringBuilder.toString()";
3433
}
35-
3634
</pre
3735
>
3836
</div>
4.86 KB
Loading

src/components/DiagramFrame/SeqDiagram/LifeLineLayer/LifeLine.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
:class="{ 'transform -translate-x-1/2': renderParticipants }"
77
:style="{ paddingTop: top + 'px', left: left + 'px' }"
88
>
9-
<participant v-if="renderParticipants" :entity="entity" :offsetTop="top" />
9+
<participant v-if="renderParticipants" :entity="entity" :offsetTop2="top" />
1010
<div v-if="renderLifeLine" class="line w0 mx-auto flex-grow w-px"></div>
1111
</div>
1212
</template>

src/components/DiagramFrame/SeqDiagram/LifeLineLayer/Participant.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default {
6969
const intersectionTop = useIntersectionTop();
7070
const [scrollTop] = useDocumentScroll();
7171
const translate = computed(() => {
72-
const participantOffsetTop = props.offsetTop || 0;
72+
const participantOffsetTop = props.offsetTop2 || 0;
7373
let top = intersectionTop.value + scrollTop.value;
7474
if (
7575
intersectionTop.value > INTERSECTION_ERROR_MARGIN &&
@@ -93,7 +93,8 @@ export default {
9393
type: Object,
9494
required: true,
9595
},
96-
offsetTop: {
96+
// offsetTop is a standard HTML property, so we use offsetTop2.
97+
offsetTop2: {
9798
type: Number,
9899
default: 0,
99100
},

src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Statement/Creation/Creation.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ import { VueSequence } from "@/index";
44
import Creation from "./Creation.vue";
55
import { Fixture } from "../../../../../../../../test/unit/parser/fixture/Fixture";
66

7-
function mountCreationWithCode(code: string, contextLocator: () => void) {
7+
function mountCreationWithCode(
8+
code: string,
9+
contextLocator: (code: string) => any,
10+
) {
811
const storeConfig = VueSequence.Store();
912
// @ts-ignore
1013
storeConfig.state.code = code;

src/components/DiagramFrame/SeqDiagram/MessageLayer/Block/Statement/Creation/Creation.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ export default {
8888
return this.context.creation();
8989
},
9090
interactionWidth() {
91-
if (this.context && this.isSelf) {
92-
return 0;
93-
}
94-
9591
let safeOffset = this.selfCallIndent || 0;
9692
return Math.abs(this.distance2(this.from, this.to) - safeOffset) - 1;
9793
},

src/parser/IsInitedFromOccurrence.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ function isInitedFromOccurrence(from) {
3333
} else if (current.creation && current.creation()) {
3434
participant = current.creation().Owner();
3535
}
36-
console.log("!!!", participant, from);
3736
if (participant === from) {
38-
console.log("!!! true");
3937
return true;
4038
}
4139
}

0 commit comments

Comments
 (0)