Skip to content

Conversation

anderoonies
Copy link
Contributor

Resolves #115
Resolves #100

Summary

setFullscreen and setSize now both perform rounding and devicePixelRatio scaling through the _resize method in the Graphics manager. This fixes issues where setFullscreen would resize based on devicePixelRatio but not scale the context up.

Changes:

  • Create _resize method for Graphics manager that performs logic for temporary canvas (for flickering) and scaling
  • Use _resize in both setSize and setFullscreen
  • Create example for setFullscreen

Checklist

  • npm test passes
  • Unit tests are included / updated
  • Documentation has been updated where relevant

@anderoonies anderoonies merged commit 95812ab into codehs:main Feb 14, 2022
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.

Context doesn't scale in fullscreen mode getWidth()/getHeight() incorrect value or rounding error
1 participant