Fix math issue

This commit is contained in:
Bill 2021-08-12 03:22:11 -04:00
parent cf3a562064
commit 567064b716

View File

@ -80,8 +80,8 @@ export const ContextMenuView: FC<ContextMenuViewProps> = props =>
const deltaY = (location.y - maxStack); const deltaY = (location.y - maxStack);
let x = (location.x - (elementRef.current.offsetWidth / 2)); let x = Math.round(location.x - (elementRef.current.offsetWidth / 2));
let y = (deltaY + offset); let y = Math.round(deltaY + offset);
const maxLeft = ((GetNitroInstance().width - elementRef.current.offsetWidth) - SPACE_AROUND_EDGES); const maxLeft = ((GetNitroInstance().width - elementRef.current.offsetWidth) - SPACE_AROUND_EDGES);
const maxTop = ((GetNitroInstance().height - elementRef.current.offsetHeight) - SPACE_AROUND_EDGES); const maxTop = ((GetNitroInstance().height - elementRef.current.offsetHeight) - SPACE_AROUND_EDGES);