vozhyk- / kanji-assist

A Rikaichan-like Assist application for Android
Apache License 2.0
0 stars 0 forks source link

Text size is not always estimated properly #15

Open vozhyk- opened 7 years ago

vozhyk- commented 7 years ago

The root cause: getTextSize(), although documented as returning the text size in pixels, sometimes returns it in dp instead.

Currently, a heuristic is used:

First, the size is treated as dp. Then the height of the text line is estimated. If it is higher than the view's height, the size is treated as px. This is a bad measure for views with wrapped text that don't have text line baselines provided. So a limit on the size in dp is used to prevent it from becoming too large.

Report the bug.