summaryrefslogtreecommitdiff
path: root/android/source/src/java/org/libreoffice/UnitConverter.java
blob: f668021b0cd71867b38e6892747ee8e0c1259681 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package org.libreoffice;


public class UnitConverter {
    public static float twipToPixel(float input, float dpi) {
        return input / 1440.0f * dpi;
    }

    public static float pixelToTwip(float input, float dpi) {
        return (input / dpi) * 1440.0f;
    }

    public static float twipsToHMM(float twips) {
        return (twips * 127 + 36) / 72;
    }
}