cjquines / qboard

The efficient digital whiteboard.
https://cjquines.com/qboard/
MIT License
83 stars 9 forks source link

How come Laser requires re-render but Eraser doesn't? #199

Open pihart opened 3 years ago

pihart commented 3 years ago

https://github.com/cjquines/qboard/blob/fe6fdc3b9f5345b451262930e22652fb6f57a5b3/src/lib/tools.ts#L197-L203

https://github.com/cjquines/qboard/blob/fe6fdc3b9f5345b451262930e22652fb6f57a5b3/src/lib/tools.ts#L163-L173

Is it because Eraser path operations are done immediately after creating the stroke, so that the render happens slightly after the invocation of the function? If so, is this guaranteed by fabric (I doubt it) or just lucky?

(Replacing Eraser with Pen in this question also raises a valid question, but the answer to that question is that you don't do anything worthy of re-render.)

cjquines commented 3 years ago

i dunno