Thanks, I will try later at night.
What would you suggest to get dpi-independent <canvas>?
Scaling is not an option, but theorically, i can measure the size of a
div containing a text in "rem" units, and use this as base to determine
the size of the pixels.
function getdpi() {
var e = document.body.appendChild (
document.createElement ('div'));
e.style.width = '1rem';
e.style.padding = '0';
var v = e.offsetWidth;
e.parentNode.removeChild(e);
return v;
}
I will have to time to do some tests tonight and see if that works..
Another option would be to use SVG to get proper scaling of the ruler,
and that will probably render faster than using a canvas.
On 05/16/13 14:42, Adán Sánchez de Pedro Crespo wrote:
I achieve uniform size on PC, Keon and Peak by using these media queries
in my CSS:
@media screen and (orientation:portrait) {
html{
font-size: 5vw;
}
}
@media screen and (orientation:landscape) {
html{
font-size: 5vh;
}
}
@media only screen and (min-resolution: 90dpi) and (min-width: 540px){
html{
font-size: 150%;
}
}
Then you only have to change the units for everything to 'rem', which is
relative to html tag's font size.
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g