Remix of https://scratch.mit.edu/projects/52150554/ by @Blue-Monkey
Shaved off ~50% of runtime (0.007 -> 0.003) Rationale for optimizations is in comments within the project. It is not optimized for pen strokes, as highest precision is assumed (by decreasing resolution and increasing pen size, it can go faster but will be less precise). I tried loop unrolling but there's no significant impact (it's a definite loop).