Skip to content

Commit b2e011e

Browse files
author
Lauren McCarthy
committed
Merge pull request #1372 from tiktuk/patch-1
Fixed pixels[] calculation in get()-docs
2 parents 60ee088 + a2a5fb6 commit b2e011e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/image/pixels.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,10 @@ p5.prototype.filter = function(operation, value) {
364364
* Getting the color of a single pixel with get(x, y) is easy, but not as fast
365365
* as grabbing the data directly from pixels[]. The equivalent statement to
366366
* get(x, y) using pixels[] with pixel density d is
367-
* <code>[pixels[(y*width*d+x)*d],
368-
* pixels[(y*width*d+x)*d+1],
369-
* pixels[(y*width*d+x)*d+2],
370-
* pixels[(y*width*d+x)*d+3]]</code>.
367+
* <code>[pixels[(y*width*d+x*4)*d],
368+
* pixels[(y*width*d+x*4)*d+1],
369+
* pixels[(y*width*d+x*4)*d+2],
370+
* pixels[(y*width*d+x*4)*d+3]]</code>.
371371
* <br><br>
372372
* See the reference for pixels[] for more information.
373373
*

0 commit comments

Comments
 (0)