jakubfiala / atrament

A small JS library for beautiful drawing and handwriting on the HTML Canvas.
http://fiala.space/atrament/demo
MIT License
1.55k stars 116 forks source link

Use a WebWorker for fill mode #26

Closed jakubfiala closed 8 months ago

jakubfiala commented 7 years ago

Need to test this, but the following approach might really enhance UX of the fill mode.

  1. initiate filling, show loading cursor, block drawing until step 5
  2. send the ImageData to a WW
  3. let the WW fill the appropriate pixels while the user revels in their unblocked UI
  4. WW sends back ImageData, we use drawImage to render it as it's a lot faster.
  5. stop filling, unblock drawing, have fun

I'd say this should be pretty high priority as it's a major UX improvement especially for using atrament canvas in a larger app with lots of other UI.

jakubfiala commented 8 months ago

this has now been added in 79f9bb161c10253d8b1dae18d6d0b78a2fb82080