Browse Source

Fix zooming bugs (changing with the selector puts zoom back to its initial value; fitting to Width doesn't change the zoom ratio estimate)

main
Tissevert 7 months ago
parent
commit
ad3321fc5b
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      js/Toolbar/Zoom.js
  2. +1
    -1
      js/View.js

+ 1
- 0
js/Toolbar/Zoom.js View File

@ -27,6 +27,7 @@ function scaleTo(geometry) {
GUI.page.style.width = '100%';
ratio = GUI.page.clientWidth / geometry.width;
scale(GUI.page, geometry, 'height');
GUI.zoomAmount.value = 10 * Math.round(10 * ratio / initialRatio);
break;
case 'fitHeight':
GUI.page.style.height = '100%';


+ 1
- 1
js/View.js View File

@ -13,7 +13,7 @@ GUI.loadScoria.addEventListener('click', importScoria);
GUI.saveScoria.addEventListener('click', exportScoria);
GUI.fitWidth.addEventListener('click', scale({fitWidth: true}));
GUI.zoomAmount.addEventListener('change', scale({zoom: GUI.zoomAmount.value}));
GUI.zoomAmount.addEventListener('change', scale(function(x) {return x;}));
GUI.fitHeight.addEventListener('click', scale({fitHeight: true}));
Keys.bind('w', scale({fitWidth: true}));
Keys.bind('h', scale({fitHeight: true}));


Loading…
Cancel
Save