mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-27 08:00:51 +01:00
Fix math issue
This commit is contained in:
parent
cf3a562064
commit
567064b716
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user