Small refactoring

This commit is contained in:
barsdeveloper
2021-12-12 20:35:41 +01:00
parent a5c4f04f2b
commit 59eb68298c
13 changed files with 26 additions and 52 deletions

View File

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

View File

@@ -19,7 +19,7 @@ export default class Unfocus extends Context {
*/
clickedSomewhere(e) {
// If target is inside the blueprint grid
if (e.target.closest("u-blueprint")) {
if (e.target.closest("ueb-blueprint")) {
return
}
this.blueprint.setFocused(false)