Skip to content

Commit

Permalink
reset panning on mouse exit
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardW committed Jan 12, 2020
1 parent 4bf82b7 commit 72a9abb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/nav-wheel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:width="size"
:height="size"
@mousemove="panSvg"
@mouseleave="resetPan"
@mousewheel.prevent="scaleSvg"
>
<g
Expand Down Expand Up @@ -105,6 +106,12 @@ export default {
},
scaleSvg($event) {
this.scale -= $event.deltaY / 1000;
},
resetPan() {
this.mouse = [
this.size / this.config.constants.scale / 2,
this.size / this.config.constants.scale / 2
];
}
},
mounted() {
Expand Down

0 comments on commit 72a9abb

Please sign in to comment.