mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-19 12:27:39 +08:00
Refactoring, various fixes
This commit is contained in:
31
js/input/keybaord/KeyboardEnableZoom.js
Normal file
31
js/input/keybaord/KeyboardEnableZoom.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import Configuration from "../../Configuration"
|
||||
import IKeyboardShortcut from "./IKeyboardShortcut"
|
||||
import Zoom from "../mouse/Zoom"
|
||||
|
||||
export default class KeyboardEnableZoom extends IKeyboardShortcut {
|
||||
|
||||
/** @type {} */
|
||||
#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)
|
||||
zoomInputObject.enableZoonIn = true
|
||||
}
|
||||
|
||||
unfire() {
|
||||
this.#zoomInputObject.enableZoom = false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user