Skip to content

ResizeEvent

Resize 事件。

事件名称

ResizeEvent.RESIZE

重置尺寸大小。

resize

关键属性

width: number

新的宽度。

height: number

新的高度。

pixelRatio?: number

新的分辨率。

old: IScreenSizeData

老的尺寸信息。

继承

Event

示例

ts
import { Leafer, Rect, ResizeEvent } from 'leafer-ui'

const leafer = new Leafer({ view: window })

const rect = new Rect({ x: 100, y: 100, fill: '#32cd79', draggable: true })

leafer.add(rect)

leafer.on(ResizeEvent.RESIZE, function (e: ResizeEvent) {
    // resize
    console.log(e.width, e.height, e.old)
})
js
import { Leafer, Rect, ResizeEvent } from 'leafer-ui'

const leafer = new Leafer({ view: window })

const rect = new Rect({ x: 100, y: 100, fill: '#32cd79', draggable: true })

leafer.add(rect)

leafer.on(ResizeEvent.RESIZE, function (e) {
    // resize
    console.log(e.width, e.height, e.old)
})

Released under the MIT License.