fix cursor position not showing up in the meta box

This commit is contained in:
Grant 2024-07-05 21:52:14 -06:00
parent 29feba063c
commit 7a915ca4bc
1 changed files with 3 additions and 4 deletions

View File

@ -69,8 +69,7 @@ const OnlineCount = () => {
};
export const CanvasMeta = () => {
const { canvasPosition, cursorPosition, pixels, config } =
useAppContext<true>();
const { canvasPosition, cursor, pixels, config } = useAppContext<true>();
const { isOpen, onOpen, onOpenChange } = useDisclosure();
return (
@ -81,11 +80,11 @@ export const CanvasMeta = () => {
<button className="btn-link" onClick={onOpen}>
({canvasPosition.x}, {canvasPosition.y})
</button>
{cursorPosition && (
{cursor.x !== undefined && cursor.y !== undefined && (
<>
{" "}
<span className="canvas-meta--cursor-pos">
(Cursor: {cursorPosition.x}, {cursorPosition.y})
(Cursor: {cursor.x}, {cursor.y})
</span>
</>
)}