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 things in getPixel function #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

petitssoldats
Copy link

Allow arguments of getPixel() equal to bound and ensure that arguments x & y are rounded

@arian
Copy link
Owner

arian commented Apr 3, 2014

Agree on the bounds.. but why should x and y be rounded?

@petitssoldats
Copy link
Author

Without that, when i want to getPixel of

{x: 182.5, y: 125}

i get in return :

[undefined, undefined, undefined, 255 ]

Because the pixels array have rounded index. Am i right ?

@petitssoldats
Copy link
Author

So ?

@LoganDark
Copy link

LoganDark commented Sep 9, 2017

Round what you pass to getPixel...

Basically, give the function what it expects and you will get what you expect from it.

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

3 participants