Skip to content

Commit 38e971c

Browse files
author
Lars Storjord
committed
Fix getPixel for pixels with zero red value.
Remove an erroneous if that causes getPixel() to fail if the red value of the pixel is zero. Fixes phaserjs#881.
1 parent 7d436a7 commit 38e971c

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

src/gameobjects/BitmapData.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -686,13 +686,10 @@ Phaser.BitmapData.prototype = {
686686

687687
index *= 4;
688688

689-
if (this.data[index])
690-
{
691-
out.r = this.data[index];
692-
out.g = this.data[++index];
693-
out.b = this.data[++index];
694-
out.a = this.data[++index];
695-
}
689+
out.r = this.data[index];
690+
out.g = this.data[++index];
691+
out.b = this.data[++index];
692+
out.a = this.data[++index];
696693

697694
return out;
698695

0 commit comments

Comments
 (0)