launcher: fix build / avoid editor import

This commit is contained in:
jean-emmanuel 2025-09-22 18:07:06 +02:00
parent 6322d91478
commit f7b42fbfb2
3 changed files with 7 additions and 9 deletions

View file

@ -1,11 +1,6 @@
import EventEmitter from '../events/event-emitter.mjs'
import {DOM, PXSCALE, INITIALZOOM, setPXSCALE} from '../globals.mjs'
var editor
;(async()=>{
editor = (await import('../editor/index.mjs')).default
})()
var mod = (navigator.platform || '').match('Mac') ? 'metaKey' : 'ctrlKey'
class Zoom extends EventEmitter {
@ -16,6 +11,7 @@ class Zoom extends EventEmitter {
this.localZoom = 1
this.lastWheelZoom = 0
this.editor = null
document.addEventListener('wheel', (event)=>{
if (event.ctrlKey) event.preventDefault()
@ -67,7 +63,7 @@ class Zoom extends EventEmitter {
setLocalZoom(zoom) {
if (!editor.enabled) return
if (this.editor && !this.editor.enabled) return
zoom = Math.max(Math.min(zoom, 4), 0.25)
if (zoom !== this.localZoom) {