Changeset 5952 in josm for trunk/src/org


Ignore:
Timestamp:
2013-05-10T15:28:09+02:00 (11 years ago)
Author:
Don-vip
Message:

fix #8610 - wrong area computation, new preference system_of_measurement.use_only_custom_area_unit(patch by Preferred)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r5903 r5952  
    13161316            double a = area / (aValue*aValue);
    13171317            boolean lowerOnly = Main.pref.getBoolean("system_of_measurement.use_only_lower_unit", false);
    1318             if (!lowerOnly && areaCustomValue > 0 && a > areaCustomValue / aValue*aValue && a < bValue*bValue / aValue*aValue)
     1318            boolean customAreaOnly = Main.pref.getBoolean("system_of_measurement.use_only_custom_area_unit", false);
     1319            if ((!lowerOnly && areaCustomValue > 0 && a > areaCustomValue / (aValue*aValue) && a < (bValue*bValue) / (aValue*aValue)) || customAreaOnly)
    13191320                return formatText(area / areaCustomValue, areaCustomName);
    1320             else if (!lowerOnly && a >= bValue*bValue / aValue*aValue)
     1321            else if (!lowerOnly && a >= (bValue*bValue) / (aValue*aValue))
    13211322                return formatText(area / (bValue*bValue), bName+"\u00b2");
    13221323            else if (a < 0.01)
     
    13471348     * @since 3406
    13481349     */
    1349     public static final SystemOfMeasurement IMPERIAL_SOM = new SystemOfMeasurement(0.3048, "ft", 1609.344, "mi");
     1350    public static final SystemOfMeasurement IMPERIAL_SOM = new SystemOfMeasurement(0.3048, "ft", 1609.344, "mi", 4046.86, "ac");
    13501351   
    13511352    /**
Note: See TracChangeset for help on using the changeset viewer.