mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-13 00:24:48 +08:00
21 lines
594 B
JavaScript
21 lines
594 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
|
|
*/
|
|
locationFromEvent(mouseEvent) {
|
|
return this.blueprint.compensateTranslation(
|
|
Utility.convertLocation(
|
|
[mouseEvent.clientX, mouseEvent.clientY],
|
|
this.movementSpace))
|
|
}
|
|
}
|