mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-13 08:34:46 +08:00
23 lines
620 B
JavaScript
23 lines
620 B
JavaScript
import IContext from "../IContext"
|
|
import Utility from "../../Utility"
|
|
|
|
export default class IPointing extends IContext {
|
|
|
|
constructor(target, blueprint, options) {
|
|
super(target, blueprint, options)
|
|
this.movementSpace = this.blueprint?.getGridDOMElement() ?? document.documentElement
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @param {MouseEvent} mouseEvent
|
|
* @returns
|
|
*/
|
|
locationFromEvent(mouseEvent) {
|
|
return this.blueprint.compensateTranslation(
|
|
Utility.convertLocation(
|
|
[mouseEvent.clientX, mouseEvent.clientY],
|
|
this.movementSpace))
|
|
}
|
|
}
|