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

Scaling retina coordinates for all callbacks #77

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

Conversation

filR
Copy link
Contributor

@filR filR commented Nov 3, 2015

Before this pull request, when in "retina land", only the draw callback and no other had its coordinate system scaled. This means that coordinates were inconsistent between draw and sketch.mouse on the one hand and all other callbacks (such as update and touchmove) on the other.

In this pull request I moved the execution of update to also be affected by the draw scaling. Furthermore I added a scaling wrapper around all other callbacks. I also removed my previous pull request which "fixes" the mouse retina coordinates for all "other" callbacks, but inconveniently breaks it for draw.

All changes affect only retina: true scenes.
Please let me know if you had another solution in mind or anything is unclear, I am happy to adjust this pull request to whatever fits the project. Thanks!

Previously only the `.draw` callback had it's coodinate system scaled, when in retina land. This meant that the coordinate system was inconsistent between, for example, `.draw` and `.update`.

This fix adds scaling to `.update` and all other callbacks (such as `mouseover`, `click`, ...).
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.

1 participant