Skip to content

Scaling retina coordinates for all callbacks#77

Open
filR wants to merge 1 commit into
soulwire:masterfrom
filR:fix_retina_coordinates
Open

Scaling retina coordinates for all callbacks#77
filR wants to merge 1 commit into
soulwire:masterfrom
filR:fix_retina_coordinates

Conversation

@filR

@filR filR commented Nov 3, 2015

Copy link
Copy Markdown
Contributor

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