aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/DiagramBox.tsx34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/client/views/nodes/DiagramBox.tsx b/src/client/views/nodes/DiagramBox.tsx
index 376dff15d..9ff2d27d2 100644
--- a/src/client/views/nodes/DiagramBox.tsx
+++ b/src/client/views/nodes/DiagramBox.tsx
@@ -48,11 +48,35 @@ export class DiagramBox extends ViewBoxAnnotatableComponent<FieldViewProps>() im
docArray.map(doc => {
if (doc.title == 'rectangle') {
DocListCast(this.Document.data).map(lineDoc => {
- if ((lineDoc.title == 'stroke' || lineDoc.title == 'line') && typeof lineDoc.x === 'number' && typeof doc.x === 'number' && typeof doc.width === 'number'&& typeof doc.height === 'number'&& typeof doc.y === 'number'&& typeof lineDoc.y === 'number') {
- if (lineDoc.x < doc.x + doc.width + (doc.width + doc.x) * 0.1 && lineDoc.x > doc.x&&lineDoc.y>doc.y&&lineDoc.y<doc.y+doc.height) {
+ if (
+ (lineDoc.title == 'stroke' || lineDoc.title == 'line') &&
+ typeof lineDoc.x === 'number' &&
+ typeof doc.x === 'number' &&
+ typeof doc.width === 'number' &&
+ typeof doc.height === 'number' &&
+ typeof doc.y === 'number' &&
+ typeof lineDoc.y === 'number'
+ ) {
+ if (lineDoc.x < doc.x + doc.width + (doc.width + doc.x) * 0.1 && lineDoc.x > doc.x && lineDoc.y > doc.y && lineDoc.y < doc.y + doc.height) {
DocListCast(this.Document.data).map(doc2 => {
- if (doc2.title == 'rectangle' && typeof lineDoc.x === 'number' && typeof lineDoc.width === 'number' && typeof doc2.x === 'number' && typeof doc2.width === 'number'&& typeof doc2.y === 'number'&& typeof doc2.height === 'number'&& typeof lineDoc.y === 'number') {
- if (lineDoc.x + lineDoc.width > doc2.x - (doc2.x - doc2.width) * 0.1 && lineDoc.x + lineDoc.width < doc2.x + doc2.width &&lineDoc.y>doc2.y&&lineDoc.y<doc2.y+doc2.height&& typeof doc.x === 'number' && typeof doc.width === 'number') {
+ if (
+ doc2.title == 'rectangle' &&
+ typeof lineDoc.x === 'number' &&
+ typeof lineDoc.width === 'number' &&
+ typeof doc2.x === 'number' &&
+ typeof doc2.width === 'number' &&
+ typeof doc2.y === 'number' &&
+ typeof doc2.height === 'number' &&
+ typeof lineDoc.y === 'number'
+ ) {
+ if (
+ lineDoc.x + lineDoc.width > doc2.x - (doc2.x - doc2.width) * 0.1 &&
+ lineDoc.x + lineDoc.width < doc2.x + doc2.width &&
+ lineDoc.y > doc2.y &&
+ lineDoc.y < doc2.y + doc2.height &&
+ typeof doc.x === 'number' &&
+ typeof doc.width === 'number'
+ ) {
mermaidCode += doc.title + Math.floor(doc.x).toString() + '-->' + doc2.title + Math.floor(doc2.x).toString() + ';';
const indexToRemove = docArray.findIndex(doc => doc === lineDoc);
if (indexToRemove !== -1) {
@@ -70,7 +94,7 @@ export class DiagramBox extends ViewBoxAnnotatableComponent<FieldViewProps>() im
}
};
render() {
- console.log(this.chartContent)
+ console.log(this.ScreenToLocalBoxXf().scale(2));
return (
<div>
<Mermaid chart={this.chartContent} />