Is it really necessary to have string width in sub-pixel width? One could expect you need to round the previously returned value in any case either by yourself or some other means before using it in any case..
Unfortunately, as for finding another way of calculating the sub-pixel width, I cannot tell is there such a way or not. And umm.. Am not too happy with this kinda changes between API levels… Just wondering out aloud.. :) — H On 11 Dec 2013, at 15:49, Ab <abe.oppenh...@gmail.com> wrote: > It is crucial for my app to be able to accurately measure Strings; I have > been usingPaint.measureText() to do this. Unfortunately, in 4.4, this method > was changed to no longer return a precise value, instead it returns a > up-rounded value. Is anyone aware of another method I can use to precisely > measure text, or have any other suggestions? > > Android source: > > Android 17 > return w*mInvCompatScaling; > Android 18 > return (float) Math.ceil(w*mInvCompatScaling); > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Android Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to android-developers+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.