Skip to content

Commit

Permalink
Enable zoom on ctrl + mouse wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed Feb 3, 2022
1 parent 37c02d1 commit 9d294ed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
"resize-observer-polyfill": "^1.5.1",
"split-grid": "^1.0.11",
"stream-browserify": "^3.0.0",
"svg-pan-zoom": "github:bumbu/svg-pan-zoom",
"svg-pan-zoom": "github:yuyichao/svg-pan-zoom",
"util": "^0.12.4",
"wavecanvas": "^1.1.0",
"yosys2digitaljs": "^0.6.0",
Expand Down
8 changes: 6 additions & 2 deletions view/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,13 @@ class DigitalJS {
fit: false,
center: false,
dblClickZoomEnabled: false,
// zoomScaleSensitivity: 0.4,
mouseWheelZoomEnabled: true,
zoomScaleSensitivity: 0.2,
panEnabled: false,
zoomEnabled: false,
zoomEnabled: true,
mouseWheelEventFilter: (evt) => {
return (evt.ctrlKey || evt.metaKey) && !evt.shiftKey && !evt.altKey;
},
onZoom: function(scale) {
// TODO
// currentScale = scale;
Expand Down

0 comments on commit 9d294ed

Please sign in to comment.