Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

add pointer position to zoom event #2377

Merged
merged 2 commits into from
Dec 2, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/network/modules/InteractionHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,10 @@ class InteractionHandler {
this.body.emitter.emit('_requestRedraw');

if (scaleOld < scale) {
this.body.emitter.emit('zoom', {direction: '+', scale: this.body.view.scale});
this.body.emitter.emit('zoom', {direction: '+', scale: this.body.view.scale, pointer: pointer});
}
else {
this.body.emitter.emit('zoom', {direction: '-', scale: this.body.view.scale});
this.body.emitter.emit('zoom', {direction: '-', scale: this.body.view.scale, pointer: pointer});
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/network/modules/components/NavigationHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class NavigationHandler {

this.body.view.scale = scale;
this.body.view.translation = { x: tx, y: ty };
this.body.emitter.emit('zoom', { direction: '+', scale: this.body.view.scale });
this.body.emitter.emit('zoom', { direction: '+', scale: this.body.view.scale, pointer: pointer });
}
_zoomOut() {
var scaleOld = this.body.view.scale;
Expand All @@ -172,7 +172,7 @@ class NavigationHandler {

this.body.view.scale = scale;
this.body.view.translation = { x: tx, y: ty };
this.body.emitter.emit('zoom', { direction: '-', scale: this.body.view.scale });
this.body.emitter.emit('zoom', { direction: '-', scale: this.body.view.scale, pointer: pointer });
}


Expand Down