Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix getPixel for pixels with zero red value. #894

Merged
merged 1 commit into from Jun 10, 2014
Merged

Fix getPixel for pixels with zero red value. #894

merged 1 commit into from Jun 10, 2014

Conversation

lstor
Copy link
Contributor

@lstor lstor commented Jun 9, 2014

Remove an erroneous if that causes getPixel() to fail if the red value of the pixel is zero.

I'm not sure what the original intent of the if check was, and I have made no attempt to preserve that intent. It is possible that it wanted to avoid out-of-bounds access, in which case a try/catch would probably be better.

Fiddle with bug: http://jsfiddle.net/FxjL8/11/
Fiddle after fixing the bug: http://jsfiddle.net/FxjL8/13/

In the first fiddle, clicking on green, blue or cyan will return a blank color object. In the second fiddle, it works for all colors.

Fixes #881.

Remove an erroneous if that causes getPixel() to fail if the red value
of the pixel is zero.

Fixes #881.
@lstor
Copy link
Contributor Author

lstor commented Jun 9, 2014

The Travis build fails on jshinting, but that's on another part of the code. My change lints perfectly 👍

photonstorm added a commit that referenced this pull request Jun 10, 2014
Fix getPixel for pixels with zero red value.
@photonstorm photonstorm merged commit bf48b1a into phaserjs:dev Jun 10, 2014
@photonstorm
Copy link
Collaborator

👍

photonstorm added a commit that referenced this pull request Jun 10, 2014
…ix #894)

If you call ArcadePhysics.collide on a Sprite vs. a Tilemap and provide a custom processCallback, the result was being ignored and the sprite was being separated regardless (thanks @aivins fix #891 #890)
@lstor lstor deleted the dev branch June 11, 2014 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants