Link implementation wip

This commit is contained in:
barsdeveloper
2022-01-18 21:21:45 +01:00
parent ce5b184b3d
commit e90277826d
19 changed files with 580 additions and 454 deletions

View File

@@ -13,13 +13,7 @@ export default class Pointing extends Context {
* @param {MouseEvent} mouseEvent
* @returns
*/
getLocation(mouseEvent) {
const scaleCorrection = 1 / Utility.getScale(this.target)
const targetOffset = this.movementSpace.getBoundingClientRect()
let location = [
Math.round((mouseEvent.clientX - targetOffset.x) * scaleCorrection),
Math.round((mouseEvent.clientY - targetOffset.y) * scaleCorrection)
]
return location
locationFromEvent(mouseEvent) {
return Utility.convertLocation([mouseEvent.clientX, mouseEvent.clientY], this.movementSpace)
}
}