Skip to content

Commit

Permalink
feat(pages): implement shift horizontal scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavotoyota committed Nov 17, 2023
1 parent b0f9699 commit d54a5be
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/client/src/code/pages/page/camera/zooming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ export class PageZooming {
}

this.page.camera.react.pos = this.page.camera.react.pos.add(
new Vec2(event.deltaX, event.deltaY).divScalar(
Math.pow(this.page.camera.react.zoom, 0.8) * 2,
),
(event.shiftKey
? new Vec2(event.deltaY, event.deltaX)
: new Vec2(event.deltaX, event.deltaY)
).divScalar(Math.pow(this.page.camera.react.zoom, 0.8) * 2),
);
}
}
Expand Down

0 comments on commit d54a5be

Please sign in to comment.