ui: local zoom tweaks and fix

This commit is contained in:
bordun 2021-03-22 09:01:17 +01:00
parent a5dd8f3726
commit 8d240fb230
2 changed files with 7 additions and 3 deletions

View file

@ -4,6 +4,10 @@
- bug fixes
- editor: error when duplicating widget while if the clipboard is empty
- ui: local zoom move issue when not in fullscreen
- misc
- faster local zoom
## 1.8.14

View file

@ -22,7 +22,7 @@ document.addEventListener('wheel', function(event) {
}
if (event.altKey) {
event.preventDefault()
let d = - event.deltaY / (10 * Math.abs(event.deltaY))
let d = - event.deltaY / (10 * Math.abs(event.deltaY)) * 2
if (!isNaN(d)) {
localZoom = Math.max(parseFloat(d) + parseFloat(localZoom), 1)
applylocalZoom()
@ -32,8 +32,8 @@ document.addEventListener('wheel', function(event) {
document.addEventListener('mousemove', function(event) {
mousePos = [
event.screenX / screen.width * 100,
event.screenY / screen.height * 100
event.pageX / window.innerWidth * 100,
event.pageY / window.innerHeight * 100
]
if (localZoom !== 1) {
applylocalZoom()