mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
zooming with ctrl + mousewheel
This commit is contained in:
parent
8417d4a4ea
commit
8a9bd4deb4
@ -13,6 +13,10 @@ class ZoomService extends Component {
|
||||
options.initializedPromise.then(() => {
|
||||
this.setZoomFactor(options.getFloat('zoomFactor'));
|
||||
});
|
||||
|
||||
window.addEventListener("wheel", event => {
|
||||
this.setZoomFactorAndSave(this.getCurrentZoom() + event.deltaY * 0.001);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,7 +29,7 @@ class ZoomService extends Component {
|
||||
|
||||
async setZoomFactorAndSave(zoomFactor) {
|
||||
if (zoomFactor >= MIN_ZOOM && zoomFactor <= MAX_ZOOM) {
|
||||
zoomFactor = Math.round(zoomFactor * 10) / 10;
|
||||
zoomFactor = Math.round(zoomFactor * 1000) / 1000;
|
||||
|
||||
this.setZoomFactor(zoomFactor);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user