Jump to content
  • Advertisement
Sign in to follow this  
smr

Unity [web] Android HTML canvas images distorted

This topic is 3050 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been working on a web application using HTML 5's new canvas tag. My code works great in Chrome and full Safari, but on Android's browser my images are blown up. I'm using the 2d context's drawImage method to render. Here's the code:
context.setTransform(1, 0, 0, 1, -viewportX, -viewportY);
context.drawImage(image, 0, 0, 32, 32, 0, 0, 32, 32);
Oh, and no scaling is applied to the matrix, which I'm sure of because it is pixel-perfect on Chrome and full Safari. Does anybody have any idea what I might be doing wrong? I haven't had an opportunity to test this on mobile Safari yet. Maybe I'll do that tonight if I get the opportunity.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!