mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
20 lines
551 B
JavaScript
Executable File
20 lines
551 B
JavaScript
Executable File
import Context from "../Context"
|
|
import Utility from "../../Utility"
|
|
|
|
export default class Pointing extends Context {
|
|
|
|
constructor(target, blueprint, options) {
|
|
super(target, blueprint, options)
|
|
this.movementSpace = this.blueprint?.getGridDOMElement() ?? document.documentElement
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @param {MouseEvent} mouseEvent
|
|
* @returns
|
|
*/
|
|
locationFromEvent(mouseEvent) {
|
|
return Utility.convertLocation([mouseEvent.clientX, mouseEvent.clientY], this.movementSpace)
|
|
}
|
|
}
|