make canvas dragging a bit snappier by calculating the drag delta ourselves
I'm really thankful for `listen` here. it makes this sort of logic super easy without having to add class fields.
This commit is contained in:
parent
bfbde0dee3
commit
740a62447e
2 changed files with 8 additions and 6 deletions
|
@ -9,11 +9,6 @@ export class Viewport {
|
|||
return Math.pow(2, this.zoomLevel * 0.25);
|
||||
}
|
||||
|
||||
panAround(x, y) {
|
||||
this.panX -= x / this.zoom;
|
||||
this.panY -= y / this.zoom;
|
||||
}
|
||||
|
||||
zoomIn(delta) {
|
||||
this.zoomLevel += delta;
|
||||
this.zoomLevel = Math.max(-16, Math.min(20, this.zoomLevel));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue