Changeset 3964 in josm


Ignore:
Timestamp:
2011-03-08T17:12:21+01:00 (9 years ago)
Author:
bastiK
Message:

fix bug: with setting "Draw only outline of areas" the text labels of areas are also hidden

Location:
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint
Files:
2 edited

Legend:

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

    r3895 r3964  
    104104
    105105        circum = nc.getDist100Pixel();
    106         boolean drawArea = circum <= Main.pref.getInteger("mappaint.fillareas", 10000000) && !paintSettings.isOutlineOnly();
     106        boolean drawArea = circum <= Main.pref.getInteger("mappaint.fillareas", 10000000);
    107107        boolean drawMultipolygon = drawArea && Main.pref.getBoolean("mappaint.multipolygon", true);
    108108        styles.setDrawMultipolygon(drawMultipolygon);
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java

    r3907 r3964  
    5656    private final boolean showIcons;
    5757
     58    private final boolean  isOutlineOnly;
     59
    5860    private final Color inactiveColor;
    5961    private final Color selectedColor;
     
    8789        this.showNames = settings.getShowNamesDistance() > circum;
    8890        this.showIcons = settings.getShowIconsDistance() > circum;
     91
     92        this.isOutlineOnly = settings.isOutlineOnly();
    8993
    9094        this.inactiveColor = PaintColors.INACTIVE.get();
     
    498502    protected void drawArea(OsmPrimitive osm, Polygon polygon, Color color, BufferedImage fillImage, float fillImageAlpha, TextElement text) {
    499503
    500         if (fillImage == null) {
    501             g.setColor(color);
    502             g.fillPolygon(polygon);
    503         } else {
    504             TexturePaint texture = new TexturePaint(fillImage,
    505                     new Rectangle(polygon.xpoints[0], polygon.ypoints[0], fillImage.getWidth(), fillImage.getHeight()));
    506             g.setPaint(texture);
    507             if (fillImageAlpha != 1f) {
    508                 g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, fillImageAlpha));
    509             }
    510             g.fill(polygon);
    511             g.setPaintMode();
     504        if (!isOutlineOnly) {
     505            if (fillImage == null) {
     506                g.setColor(color);
     507                g.fillPolygon(polygon);
     508            } else {
     509                TexturePaint texture = new TexturePaint(fillImage,
     510                        new Rectangle(polygon.xpoints[0], polygon.ypoints[0], fillImage.getWidth(), fillImage.getHeight()));
     511                g.setPaint(texture);
     512                if (fillImageAlpha != 1f) {
     513                    g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, fillImageAlpha));
     514                }
     515                g.fill(polygon);
     516                g.setPaintMode();
     517            }
    512518        }
    513519
Note: See TracChangeset for help on using the changeset viewer.