Changeset 2664 in josm


Ignore:
Timestamp:
2009-12-20T08:55:59+01:00 (14 years ago)
Author:
jttt
Message:

Fix color in inactive mode

File:
1 edited

Legend:

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

    r2663 r2664  
    342342
    343343    private void displaySegments(GeneralPath path, Color color, int width, float dashed[], Color dashedColor) {
    344         if (path != null) {
    345             g.setColor(color);
    346             if (useStrokes > dist) {
    347                 if (dashed.length > 0) {
    348                     g.setStroke(new BasicStroke(width,BasicStroke.CAP_BUTT,BasicStroke.JOIN_ROUND,0, dashed,0));
    349                 } else {
    350                     g.setStroke(new BasicStroke(width,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND));
    351                 }
     344        g.setColor(inactive ? inactiveColor : color);
     345        if (useStrokes > dist) {
     346            if (dashed.length > 0) {
     347                g.setStroke(new BasicStroke(width,BasicStroke.CAP_BUTT,BasicStroke.JOIN_ROUND,0, dashed,0));
     348            } else {
     349                g.setStroke(new BasicStroke(width,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND));
     350            }
     351        }
     352        g.draw(path);
     353
     354        if(!inactive && useStrokes > dist && dashedColor != null) {
     355            g.setColor(dashedColor);
     356            if (dashed.length > 0) {
     357                float[] dashedOffset = new float[dashed.length];
     358                System.arraycopy(dashed, 1, dashedOffset, 0, dashed.length - 1);
     359                dashedOffset[dashed.length-1] = dashed[0];
     360                float offset = dashedOffset[0];
     361                g.setStroke(new BasicStroke(width,BasicStroke.CAP_BUTT,BasicStroke.JOIN_ROUND,0,dashedOffset,offset));
     362            } else {
     363                g.setStroke(new BasicStroke(width,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND));
    352364            }
    353365            g.draw(path);
    354 
    355             if(useStrokes > dist && dashedColor != null) {
    356                 g.setColor(dashedColor);
    357                 if (dashed.length > 0) {
    358                     float[] dashedOffset = new float[dashed.length];
    359                     System.arraycopy(dashed, 1, dashedOffset, 0, dashed.length - 1);
    360                     dashedOffset[dashed.length-1] = dashed[0];
    361                     float offset = dashedOffset[0];
    362                     g.setStroke(new BasicStroke(width,BasicStroke.CAP_BUTT,BasicStroke.JOIN_ROUND,0,dashedOffset,offset));
    363                 } else {
    364                     g.setStroke(new BasicStroke(width,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND));
    365                 }
    366                 g.draw(path);
    367             }
    368 
    369             if(useStrokes > dist) {
    370                 g.setStroke(new BasicStroke());
    371             }
     366        }
     367
     368        if(useStrokes > dist) {
     369            g.setStroke(new BasicStroke());
    372370        }
    373371    }
Note: See TracChangeset for help on using the changeset viewer.