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

Fixed _clamp function for scaled viewports #955

Merged
merged 2 commits into from
Sep 19, 2015
Merged

Conversation

gopeter
Copy link
Contributor

@gopeter gopeter commented Aug 17, 2015

This is a pull request for #954.

@gopeter
Copy link
Contributor Author

gopeter commented Aug 17, 2015

Looking at the docs, the code actually should be like this PR:

* `x` between `(-Crafty.viewport._x)` and `(-Crafty.viewport._x + (Crafty.viewport._width / Crafty.viewport._scale))`
* `y` between `(-Crafty.viewport._y)` and `(-Crafty.viewport._y + (Crafty.viewport._height / Crafty.viewport._scale))`

@starwed
Copy link
Member

starwed commented Sep 19, 2015

Looks good to me. I think our current set of tests specifically disable the clamp effect, but we should probably add some additional tests to catch issues like this in the future.

starwed added a commit that referenced this pull request Sep 19, 2015
Fixed _clamp function for scaled viewports
@starwed starwed merged commit 120d227 into craftyjs:develop Sep 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants