@@ -309,12 +309,11 @@ function draw(pickColor, superSamples)
309
309
// Only enable one render at a time
310
310
renderId += 1 ;
311
311
312
-
313
312
function drawLineSuperSampled ( Ci , off , Cr_init , Cr_step )
314
313
{
315
314
var Cr = Cr_init ;
316
315
317
- for ( var x = 0 ; x < canvas . width ; ++ x , Cr += Cr_step , off += 4 ) {
316
+ for ( var x = 0 ; x < canvas . width ; ++ x , Cr += Cr_step ) {
318
317
var color = [ 0 , 0 , 0 , 255 ] ;
319
318
320
319
for ( var s = 0 ; s < superSamples ; ++ s ) {
@@ -326,36 +325,36 @@ function draw(pickColor, superSamples)
326
325
327
326
color = divRGB ( color , superSamples ) ;
328
327
329
- img . data [ off ] = color [ 0 ] ;
330
- img . data [ off + 1 ] = color [ 1 ] ;
331
- img . data [ off + 2 ] = color [ 2 ] ;
332
- img . data [ off + 3 ] = 255 ;
328
+ img . data [ off ++ ] = color [ 0 ] ;
329
+ img . data [ off ++ ] = color [ 1 ] ;
330
+ img . data [ off ++ ] = color [ 2 ] ;
331
+ img . data [ off ++ ] = 255 ;
333
332
}
334
333
}
335
334
336
335
function drawLine ( Ci , off , Cr_init , Cr_step )
337
336
{
338
337
var Cr = Cr_init ;
339
338
340
- for ( var x = 0 ; x < canvas . width ; ++ x , Cr += Cr_step , off += 4 ) {
339
+ for ( var x = 0 ; x < canvas . width ; ++ x , Cr += Cr_step ) {
341
340
var p = iterateEquation ( Cr , Ci , escapeRadius , steps ) ;
342
341
var color = pickColor ( steps , p [ 0 ] , p [ 1 ] , p [ 2 ] ) ;
343
- img . data [ off ] = color [ 0 ] ;
344
- img . data [ off + 1 ] = color [ 1 ] ;
345
- img . data [ off + 2 ] = color [ 2 ] ;
346
- img . data [ off + 3 ] = 255 ;
342
+ img . data [ off ++ ] = color [ 0 ] ;
343
+ img . data [ off ++ ] = color [ 1 ] ;
344
+ img . data [ off ++ ] = color [ 2 ] ;
345
+ img . data [ off ++ ] = 255 ;
347
346
}
348
347
}
349
348
350
349
function drawSolidLine ( y , color )
351
350
{
352
351
var off = y * canvas . width ;
353
352
354
- for ( var x = 0 ; x < canvas . width ; ++ x , off += 4 ) {
355
- img . data [ off + 0 ] = color [ 0 ] ;
356
- img . data [ off + 1 ] = color [ 1 ] ;
357
- img . data [ off + 2 ] = color [ 2 ] ;
358
- img . data [ off + 3 ] = color [ 3 ] ;
353
+ for ( var x = 0 ; x < canvas . width ; ++ x ) {
354
+ img . data [ off ++ ] = color [ 0 ] ;
355
+ img . data [ off ++ ] = color [ 1 ] ;
356
+ img . data [ off ++ ] = color [ 2 ] ;
357
+ img . data [ off ++ ] = color [ 3 ] ;
359
358
}
360
359
}
361
360
0 commit comments