Blueprint focusable

This commit is contained in:
barsdeveloper
2021-11-06 20:59:00 +01:00
parent ceb07688f2
commit afa27bf42c
13 changed files with 318 additions and 79 deletions

View File

@@ -4,6 +4,7 @@ import Pointing from "./Pointing"
* This class manages the ui gesture of mouse click and drag. Tha actual operations are implemented by the subclasses.
*/
export default class MouseClickDrag extends Pointing {
constructor(target, blueprint, options) {
super(target, blueprint, options)
this.clickButton = options?.clickButton ?? 0
@@ -16,6 +17,7 @@ export default class MouseClickDrag extends Pointing {
let self = this
this.mouseDownHandler = e => {
this.blueprint.setFocused(true)
switch (e.button) {
case self.clickButton:
// Either doesn't matter or consider the click only when clicking on the parent, not descandants