Skip to content

Fix things in getPixel function#5

Open
petitssoldats wants to merge 1 commit into
arian:masterfrom
petitssoldats:master
Open

Fix things in getPixel function#5
petitssoldats wants to merge 1 commit into
arian:masterfrom
petitssoldats:master

Conversation

@petitssoldats
Copy link
Copy Markdown

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

@arian
Copy link
Copy Markdown
Owner

arian commented Apr 3, 2014

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

@petitssoldats
Copy link
Copy Markdown
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
Copy Markdown
Author

So ?

@LoganDark
Copy link
Copy Markdown

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.

3 participants