diff --git a/td.vue/src/components/GraphButtons.vue b/td.vue/src/components/GraphButtons.vue index 1f47dec7..dd000d91 100644 --- a/td.vue/src/components/GraphButtons.vue +++ b/td.vue/src/components/GraphButtons.vue @@ -97,10 +97,20 @@ export default { } }, zoomIn() { - this.graph.zoom(0.2); + if (this.graph.zoom() < 1.0) { + this.graph.zoom(0.1); + } else { + this.graph.zoom(0.2); + } + console.debug('zoom to ' + this.graph.zoom()); }, zoomOut() { - this.graph.zoom(-0.2); + if (this.graph.zoom() < 1.0) { + this.graph.zoom(-0.1); + } else { + this.graph.zoom(-0.2); + } + console.debug('zoom to ' + this.graph.zoom()); }, deleteSelected() { this.graph.removeCells(this.graph.getSelectedCells()); diff --git a/td.vue/src/service/x6/graph/graph.js b/td.vue/src/service/x6/graph/graph.js index 69bf0140..1f285004 100644 --- a/td.vue/src/service/x6/graph/graph.js +++ b/td.vue/src/service/x6/graph/graph.js @@ -30,10 +30,10 @@ const getEditGraph = (container, ctor = Graph) => { enabled: true, // provides panning using shift key, as we have to disable scroller.pannable modifiers: ['shift'] }, - scaling: { - min : 0.1 , // default value is 0.01 - max : 10 , // default value is 16 - }, + scaling: { + min : 0.1 , // default value is 0.01 + max : 3.2 , // default value is 16 + }, preventDefaultContextMenu: false }); graph