protect from division by 0 when horizontally scrolling

This commit is contained in:
joshuaboud 2022-06-13 15:52:29 -03:00
parent fc54b92d06
commit 1ec50e2399
No known key found for this signature in database
GPG Key ID: 17EFB59E2A8BF50E

View File

@ -231,6 +231,8 @@ export default {
event.preventDefault();
event.stopPropagation();
console.log(event.deltaY);
if (!event.deltaY)
return;
const direction = -event.deltaY / Math.abs(event.deltaY);
const scale = Math.pow(1.1, direction);
const candidate = settings.directoryView.gridEntrySize * scale;