silexlabs / Cocktail

An HTML/CSS rendering engine for the Haxe language
http://www.silexlabs.org/haxe/cocktail/
Other
192 stars 34 forks source link

HiDPI / Retina support #396

Open clemos opened 10 years ago

clemos commented 10 years ago

We need to implement basic Retina support for Flash target. Currently, in Flash on Retina displays, BitmapData are drawn with 2x2 physical pixels, so drawing for example a TextField to a BitmapData will result in a resolution loss. To workaround this issue, we had the idea to multiply the dimensions of the BitmapData by Stage.contentsScaleFactor (which would correspond to actually available physical pixels) and then scale down the Bitmap / Sprite by ( 1 / Stage.contentsScaleFactor ). This seems to be the current behaviour on NME, actually (the runtime simply uses physical resolution) Any insight as to how to implement this, preferably the easy way :p ?

clemos commented 10 years ago

I've actually managed to implement this quite easily. I'll send a pull request some time. Thanks anyway ;)

yanhick commented 10 years ago

Cool !

Glad I could help doing nothing ;)

2014-01-28 Clément Charmet notifications@github.com

I've actually managed to implement this quite easily. I'll send a pull request some time. Thanks anyway ;)

Reply to this email directly or view it on GitHubhttps://github.com/silexlabs/Cocktail/issues/396#issuecomment-33470308 .