Skip to content

Commit b65ff5a

Browse files
author
Ritika Mishra
committed
updated data frame logic
1 parent 07a459f commit b65ff5a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/Canvas.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const Canvas = forwardRef(
7171

7272

7373
useEffect(() => {
74-
numXRef.current= (getpoints(selectedBits) * currentValue)+1;
74+
numXRef.current= (getpoints(selectedBits) * currentValue);
7575

7676
}, [ currentValue]);
7777

@@ -310,7 +310,7 @@ const Canvas = forwardRef(
310310
line.setY(currentSweepPos.current[i] % line.numPoints, data[i + 1]);
311311

312312
// Clear the next point to create a gap (optional, for visual effect)
313-
const clearPosition = (currentSweepPos.current[i] + (numXRef.current / 100)) % line.numPoints;
313+
const clearPosition = Math.ceil((currentSweepPos.current[i] + (numXRef.current / 100)) % line.numPoints);
314314
line.setY(clearPosition, NaN);
315315

316316
// Increment the sweep position for the current line

0 commit comments

Comments
 (0)