fix: zoom functions (#739)
parent
ca5107f599
commit
d8db82ee8b
|
@ -116,6 +116,18 @@ class Zoom extends ListComboBox {
|
||||||
this.$input.shadowRoot.querySelector('[part~="input"]').style.width = this[internal.state].inputsize
|
this.$input.shadowRoot.querySelector('[part~="input"]').style.width = this[internal.state].inputsize
|
||||||
}
|
}
|
||||||
if (changed.inputPartType) {
|
if (changed.inputPartType) {
|
||||||
|
const self = this
|
||||||
|
this.$input.setAttribute('step', '10')
|
||||||
|
this.$input.setAttribute('min', '0')
|
||||||
|
// Handle NumberSpinBox input.
|
||||||
|
this.$input.addEventListener('change', function (e) {
|
||||||
|
e.preventDefault()
|
||||||
|
const value = e.detail?.value
|
||||||
|
if (value) {
|
||||||
|
const changeEvent = new CustomEvent('change', { detail: { value } })
|
||||||
|
self.dispatchEvent(changeEvent)
|
||||||
|
}
|
||||||
|
})
|
||||||
// Wire up handler on new input.
|
// Wire up handler on new input.
|
||||||
this.addEventListener('close', (e) => {
|
this.addEventListener('close', (e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
|
@ -56,7 +56,7 @@ class BottomPanel {
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
const zoomlevel = Number(value) > 0.1 ? Number(value) > 0.1 : 0.1
|
const zoomlevel = Number(value) > 0.1 ? Number(value) * 0.01 : 0.1
|
||||||
const zoom = this.editor.svgCanvas.getZoom()
|
const zoom = this.editor.svgCanvas.getZoom()
|
||||||
const { workarea } = this.editor
|
const { workarea } = this.editor
|
||||||
this.editor.zoomChanged(window, {
|
this.editor.zoomChanged(window, {
|
||||||
|
|
Loading…
Reference in New Issue