mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
26 lines
652 B
JavaScript
Executable File
26 lines
652 B
JavaScript
Executable File
import IMouseWheel from "./IMouseWheel"
|
|
|
|
export default class Zoom extends IMouseWheel {
|
|
|
|
#enableZoonIn = false
|
|
get enableZoonIn() {
|
|
return this.#enableZoonIn
|
|
}
|
|
set enableZoonIn(value) {
|
|
if (value == this.#enableZoonIn) {
|
|
return
|
|
}
|
|
this.#enableZoonIn = value
|
|
}
|
|
|
|
wheel(variation, location) {
|
|
let zoomLevel = this.blueprint.getZoom()
|
|
variation = -variation
|
|
if (!this.enableZoonIn && zoomLevel == 0 && variation > 0) {
|
|
return
|
|
}
|
|
zoomLevel += variation
|
|
this.blueprint.setZoom(zoomLevel, location)
|
|
}
|
|
}
|