mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-13 16:44:49 +08:00
34 lines
826 B
JavaScript
34 lines
826 B
JavaScript
// @ts-check
|
|
|
|
import Configuration from "../../Configuration"
|
|
import IKeyboardShortcut from "./IKeyboardShortcut"
|
|
import Zoom from "../mouse/Zoom"
|
|
|
|
export default class KeyboardEnableZoom extends IKeyboardShortcut {
|
|
|
|
/** @type {Zoom} */
|
|
#zoomInputObject
|
|
|
|
/**
|
|
* @param {HTMLElement} target
|
|
* @param {import("../../Blueprint").default} blueprint
|
|
* @param {Object} options
|
|
*/
|
|
constructor(target, blueprint, options = {}) {
|
|
options = {
|
|
...options,
|
|
activationKeys: Configuration.enableZoomIn
|
|
}
|
|
super(target, blueprint, options)
|
|
}
|
|
|
|
fire() {
|
|
this.#zoomInputObject = this.blueprint.getInputObject(Zoom)
|
|
this.#zoomInputObject.enableZoonIn = true
|
|
}
|
|
|
|
unfire() {
|
|
this.#zoomInputObject.enableZoonIn = false
|
|
}
|
|
}
|