summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Utilities.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/Utilities.java')
-rw-r--r--src/com/android/launcher3/Utilities.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index e34f509da..b0e096a2e 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -686,11 +686,11 @@ public final class Utilities {
/**
* Calculates the height of a given string at a specific text size.
*/
- public static float calculateTextHeight(float textSizePx) {
+ public static int calculateTextHeight(float textSizePx) {
Paint p = new Paint();
p.setTextSize(textSizePx);
Paint.FontMetrics fm = p.getFontMetrics();
- return -fm.top + fm.bottom;
+ return (int) Math.ceil(fm.bottom - fm.top);
}
/**