Skip to content

Commit

Permalink
update passing of x,y values
Browse files Browse the repository at this point in the history
  • Loading branch information
deveshidwivedi committed Jun 20, 2024
1 parent a647584 commit 1aae389
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions modules/room/components/Canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const Canvas = () => {
}, [drawing, ctx]);

return (
<div className="h-full w-full overflow-hidden">
<div className=" relative h-full w-full overflow-hidden">
<motion.canvas
ref={canvasRef}
width={CANVAS_SIZE.width}
Expand Down Expand Up @@ -134,8 +134,6 @@ const Canvas = () => {
/>
<Minimap
ref={smallCanvasRef}
x={x}
y={y}
dragging={dragging}
setMovedMiniMap={setMovedMiniMap}
/>
Expand Down
6 changes: 3 additions & 3 deletions modules/room/components/Minimap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import { useViewportSize } from "@/common/hooks/useViewportSize";
import { MotionValue, useMotionValue } from "framer-motion";
import {Dispatch, SetStateAction, forwardRef, useEffect, useRef} from "react";
import {motion} from "framer-motion";
import { useBoardPosition } from "../hooks/useBoardPosition";


const Minimap = forwardRef<
HTMLCanvasElement,{
x: MotionValue<number>;
y: MotionValue<number>;
dragging: boolean;
setMovedMiniMap: Dispatch<SetStateAction<boolean>>;
}
>(({x, y, dragging, setMovedMiniMap}, ref)=>{
>(({ dragging, setMovedMiniMap}, ref)=>{
const {x,y} = useBoardPosition();
const containerRef = useRef<HTMLDivElement>(null);
const {width, height} = useViewportSize();

Expand Down

0 comments on commit 1aae389

Please sign in to comment.