mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 12:33:03 +00:00
add padding to normalize out of bounds context menu
This commit is contained in:
@@ -20,18 +20,17 @@ export default (mouseX, mouseY) => {
|
||||
let normalizedX = mouseX;
|
||||
let normalizedY = mouseY;
|
||||
|
||||
// console.log(mouseX, mouseY);
|
||||
// ? normalize on X
|
||||
if (outOfBoundsOnX) {
|
||||
normalizedX = scopeOffsetX + scope.clientWidth - contextMenu.clientWidth;
|
||||
normalizedX -= 10
|
||||
}
|
||||
|
||||
// ? normalize on Y
|
||||
if (outOfBoundsOnY) {
|
||||
normalizedY = scopeOffsetY + scope.clientHeight - contextMenu.clientHeight;
|
||||
normalizedY -= 10
|
||||
}
|
||||
|
||||
console.log(normalizedX, normalizedY);
|
||||
|
||||
return { normalizedX, normalizedY };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user