package com.kennycason.kumo.font.scale;

/**
 * Created by kenny on 6/30/14.
 */
public class LogFontScalar implements FontScalar {

    private final int minFont;
    private final int maxFont;

    public LogFontScalar(final int minFont, final int maxFont) {
        this.minFont = minFont;
        this.maxFont = maxFont;
    }

    @Override
    public float scale(final int value, final int minValue, final int maxValue) {
        final double leftSpan = Math.sqrt(maxValue) - Math.sqrt(minValue);
        final double rightSpan = maxFont - minFont;

        // Convert the left range into a 0-1 range
        final double valueScaled = (Math.log(value) - Math.log(minValue)) / leftSpan;

        // Convert the 0-1 range into a value in the right range.
        return (float) (minFont + (valueScaled * rightSpan));
    }

}

@@ -458,20 +458,19 @@
  = Math.
-sqrt
+log
 (maxValu
@@ -483,12 +483,11 @@
 ath.
-sqrt
+log
 (min

Replace usage of Math.sqrt in with Math.log