PathFinding.js icon indicating copy to clipboard operation
PathFinding.js copied to clipboard

when drawing walls very fast, the walls have holes

Open roryokane opened this issue 13 years ago • 0 comments

steps to reproduce

Drag the mouse very quickly across the grid, in any shape.

expected

I get a continuous line of walls where I dragged my mouse.

actual

I get walls only in some of those places. Though I dragged the shape of one continuous wall, the wall has big holes.

how to implement

  • When drawing walls, while the mouse is down, ...
  • instead of just drawing a wall under the current cursor position, ...
  • always remember the last cursor position, and use a line-drawing algorithm to draw a continuous line from the previous position to the current position.

roryokane avatar Apr 21 '12 21:04 roryokane