Earlier quoted context omitted.
Very nice! I changed it a little bit to optimise rendering just in case you don't know about 'requestAnimationFrame()' ( https://developer.mozilla.org/en-US/docs/Web/API/window/requ... ): https://jsfiddle.net/65q7c5to/
What do all the context transformation lines do in this example? It seems to work just as well with clearRect on its own.
Show HN: RoughJS – Create hand-drawn graphics using JavaScript
81–90 of 103 posts
Re: Show HN: RoughJS – Create hand-drawn graphics using JavaScript
#82This is a very fun library. Following the tip in these comments from @bcjordan to repeatedly re-render, I've forked a little physics notebook by Jim Bumgardner apply Rough.js to the circle rendering: https://beta.observablehq.com/@jashkenas/tumble-wheel-with-r... Wheee. Edit: Too much fun. Here's another: https://beta.observablehq.com/@jashkenas/scratchy-eyes
This is not working in Firefox. Not sure why.
Re: Show HN: RoughJS – Create hand-drawn graphics using JavaScript
#83Re: Show HN: RoughJS – Create hand-drawn graphics using JavaScript
#84Earlier quoted context omitted.
What do all the context transformation lines do in this example? It seems to work just as well with clearRect on its own.
There's only one such line. In general it's a good idea to reset the transform before clearing as the (0, 0, w, h) rectangle may not cover the whole canvas anymore. In this toy example there obviously isn't another transform so it's without function.
Re: Show HN: RoughJS – Create hand-drawn graphics using JavaScript
#85Re: Show HN: RoughJS – Create hand-drawn graphics using JavaScript
#86Re: Show HN: RoughJS – Create hand-drawn graphics using JavaScript
#87Anybody know of a tool that can convert ascii drawings (in markdown) to this?