Changeset 9076 in josm for trunk


Ignore:
Timestamp:
2015-12-01T00:17:33+01:00 (8 years ago)
Author:
bastiK
Message:

mapcss: partial fill - fix for [9063] - use scale instead of circum (otherwise it would depend on latitude)

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintSettings.java

    r9071 r9076  
    117117        unclosedAreaHighlight = Main.pref.getBoolean("draw.unclosed_area_partial_fill_highlight", false);
    118118        unclosedAreaHighlightWidth = Main.pref.getDouble("draw.unclosed_area_partial_fill_highlight.width", 80);
    119         partialFillThreshold = Main.pref.getDouble("draw.area.partial_fill_threshold", 50);
     119        partialFillThreshold = Main.pref.getDouble("draw.area.partial_fill_threshold", 70);
    120120    }
    121121
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r9075 r9076  
    288288
    289289    private double circum;
     290    private double scale;
    290291
    291292    private MapPaintSettings paintSettings;
     
    630631                        AreaAndPerimeter ap = pd.getAreaAndPerimeter();
    631632                        // if partial fill would only leave a small gap in the center ...
    632                         if (ap.getPerimeter() * extent * circum / 100 > partialFillThreshold / 100 * ap.getArea()) {
     633                        if (ap.getPerimeter() * extent * scale > partialFillThreshold / 100 * ap.getArea()) {
    633634                            // ... turn it off and fill completely
    634635                            extent = null;
     
    660661            AreaAndPerimeter ap = Geometry.getAreaAndPerimeter(w.getNodes());
    661662            // if partial fill would only leave a small gap in the center ...
    662             if (ap.getPerimeter() * extent * circum / 100 > partialFillThreshold / 100 * ap.getArea()) {
     663            if (ap.getPerimeter() * extent * scale > partialFillThreshold / 100 * ap.getArea()) {
    663664                // ... turn it off and fill completely
    664665                extent = null;
     
    15131514
    15141515        circum = nc.getDist100Pixel();
     1516        scale = nc.getScale();
    15151517
    15161518        leftHandTraffic = Main.pref.getBoolean("mappaint.lefthandtraffic", false);
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r9073 r9076  
    215215
    216216    /**
    217      * @return Returns the center point. A copy is returned, so users cannot
    218      *      change the center by accessing the return value. Use zoomTo instead.
     217     * Returns the current center of the viewport.
     218     *
     219     * (Use {@link #zoomTo(EastNorth)} to the change the center.)
     220     *
     221     * @return the current center of the viewport
    219222     */
    220223    public EastNorth getCenter() {
     
    222225    }
    223226
     227    /**
     228     * Returns the current scale.
     229     *
     230     * In east/north units per pixel.
     231     *
     232     * @return the current scale
     233     */
    224234    public double getScale() {
    225235        return scale;
Note: See TracChangeset for help on using the changeset viewer.