Skip to content

Commit 7736dc5

Browse files
committed
fix: panning triggers minimap
1 parent aa549e3 commit 7736dc5

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

src/js/app.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ export let app;
3737
store,
3838
components,
3939
data: {
40-
paper: Paper, // in order to watch translation
40+
paper: Paper, // necessary to watch translation and scale
4141
workflowId: undefined
4242
},
4343
computed: {
4444
translation() {
45-
return Paper.translation;
45+
return this.paper.translation;
4646
},
4747
scale() {
48-
return Paper.scale;
48+
return this.paper.scale;
4949
},
5050
// this computed method is necessary since we shouldn't
5151
// listen to the store directly
@@ -117,12 +117,6 @@ export let app;
117117
undo() {
118118
UndoRedoHistory.undo();
119119
},
120-
addLink(payload) {
121-
this.$addLink({ ...payload });
122-
},
123-
deleteLink(payload) {
124-
this.$deleteLink({ ...payload });
125-
},
126120
deleteElementByCellView(cellView) {
127121
const boxId = cellView.model.attributes.boxId;
128122
this.$deleteElements({

src/js/classes/Paper.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class Paper {
181181
distance: -30,
182182
action: function() {
183183
this.model.remove({ ui: true, tool: this.cid });
184-
app.deleteLink({ link: this.model });
184+
app.$deleteLink({ link: this.model });
185185
}
186186
})
187187
]
@@ -194,7 +194,7 @@ class Paper {
194194
});
195195

196196
this._paper.on("link:connect", linkView => {
197-
app.addLink({ link: linkView.model.attributes });
197+
app.$addLink({ link: linkView.model.attributes });
198198
});
199199

200200
this._paper.on(

src/js/components/minimap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import Paper from "../classes/Paper";
1717
const SCALE_CONTENT_PADDING = 10;
1818

1919
const Minimap = Vue.component("Minimap", {
20-
props: ["movedElements", "scale"],
20+
props: ["movedElements", "scale", "translation"],
2121
data: function() {
2222
return {
2323
mapDragFlag: false,

0 commit comments

Comments
 (0)