-
Notifications
You must be signed in to change notification settings - Fork 85
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
Retina on OS X and iOS #11
Comments
Sorry, I don't have a Retina display iOS device, so fixing this might take a while. |
Not a huge deal- this is definitely in the enhancement category, not a bug. On Dec 14, 2012, at 5:44 PM, John Wiseman [email protected] wrote: Sorry, I don't have a Retina display iOS device, so fixing this might take — |
This looks like it might be helpful: http://joubert.posterous.com/crisp-html-5-canvas-text-on-mobile-phones-and Also I tried to reproduce using the XCode iPhone simulator in Retina mode, but I'm not sure if it worked. Can someone post a screenshot showing the problem? |
To my eyes the bug is still there - compare the fuzzy "20" on the left and This isn't a high priority bug, by any means - just a "nice to have" On Sat, Feb 23, 2013 at 3:27 PM, David Court [email protected]:
|
The reason this happens is because of the way Webkit renders the canvas on retina devices. On a retina device, the canvas is actually four times the pixels, but the backing store (the offscreen context in which you draw your content) is still in old-style physical pixels. Webkit scales up that content in the backing store before drawing - which is where the blurriness comes from. Just a heads up with some context: what you want to investigate is webkit's window.devicePixelRatio property. Basically, Webkit can report whether it's got a standard 1:1 pixel ratio or a 2:1 pixel ratio (retina). If you get a devicePixelRatio of 2, you know you're on a retina device and can respond accordingly. Unfortunately, how to deal with it is mostly a hack right now. When you get a devicePixelRatio of 2, but a webkitBackingStorePixelRatio property of 1, you essentially have to double the dimensions of the canvas (i.e. a 640_480 canvas becomes 1280_960), and then scale the element back down after rendering with CSS. Not elegant, but it works. The most annoying thing is that Safari 6 was the one browser that handled this properly: it double the backing store automatically on retina devices. Chrome/Firefox/Mobile Safari didn't. And as of Safari 7, neither does Safari :/ |
Cool⚡️ |
Canvas rendering on Retina iOS screens is wonky. The PFD looks pixel-doubled while regular HTML text looks ok.
The text was updated successfully, but these errors were encountered: