Look at the skin file properties file to see the ratio variable used to calculate the density of the display. Maybe there was a mistake in generating this specific theme file. You can see the skins here: https://github.com/codenameone/codenameone-skins On Tuesday, January 5, 2021 at 1:37:01 PM UTC+2 P5music wrote:
> This question is related to > > https://groups.google.com/g/codenameone-discussions/c/ohobrY3v83s/m/ypQ8fmnvAQAJ > > In my code there is the need to have a standard length. The instruction to > do so is: > > int frameHeight= (int) (Utils.dpi()* 0.393701); > > This should be a centimeter. > (Utils.dpi() is a convenience method to get the dpi from the Display. > getInstance().getDeviceDensity() value) > > I tested it with two skins: > > Android Note5 (dpi=540 xxhdpi -> 212px) > > iOS iPad3 (dpi=240 hdpi -> 94px) > > The length measure is used in some HTML, displayed in a BrowserComponent. > > When running in simulator I get that > the device is different - OK > the font size and the icons size or images size are the same - OK > the calculated pixels value for 1cm has different size, it is bigger in > the Note5 skin. > > Should I use CN.convertToPixels()? > > Thanks in advance > > -- You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/cee67b3f-d0bf-4e14-8f67-dc5a3f5d5b18n%40googlegroups.com.
