cslarsen / mandelbrot-js

Fast rendering of the Mandelbrot set in HTML5 canvas using JavaScript
https://csl.name/mandelbrot/
351 stars 77 forks source link

Prevent scanline from running if it's not targeting the same canvas size it started at #1

Closed yelirekim closed 12 years ago

yelirekim commented 12 years ago

If you have draw being called again before the previous call to it has finished rendering, this will prevent lines which don't fit in the active canvas context from being drawn. Your example ties draw to pressing a button so it could be hard to see this have any significance, but I'm playing around with one where I tie draw to resize and it was getting really messy without this check in there. Doesn't seem to impact performance in any significant way.