I have a strange issue that occurs when drawing paths using batching with MoveToAsync, LineToAsync nad StrokeAsync. As long as I draw a static image, everything is fine, but in my case the user can zoom and pan the content of the canvas. While this works for shapes like rectangles, paths have an issue: Paths from previous renders remain on the canvas, although it has been cleared using ClearRectAsync. Rectangles don't have this problem.
To reproduce:
Clone the repository
Open DrawingRectangles.razor
Replace the content with my modified code below. This code draws rectangles, paths and allows to pan with the mouse
Start "Canvas_ServerSide"
Navigate to "Drawing rectangles"
Move the mouse cursor over the canvas, this will pan the content
Notice that rectangles move around as expected, but paths don't get cleared up and paths from their previous positions are still drawn
Expected behavior:
ClearRectAsync should clear the canvas and only the paths drawn after the last ClearRectAsync are visible
Hi,
I have a strange issue that occurs when drawing paths using batching with MoveToAsync, LineToAsync nad StrokeAsync. As long as I draw a static image, everything is fine, but in my case the user can zoom and pan the content of the canvas. While this works for shapes like rectangles, paths have an issue: Paths from previous renders remain on the canvas, although it has been cleared using ClearRectAsync. Rectangles don't have this problem.
To reproduce:
Expected behavior: ClearRectAsync should clear the canvas and only the paths drawn after the last ClearRectAsync are visible