Ignore:
Timestamp:
2011-02-11T23:00:56+01:00 (13 years ago)
Author:
bastiK
Message:

fixed #5673 - "oneway" arrows on ways should be painted in different style than way-direction arrows

File:
1 edited

Legend:

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

    r3888 r3889  
    193193        the way is tagged with a direction key
    194194        (even if the tag is negated as in oneway=false) or the way is selected */
    195         boolean showDirection = !isModifier && (selected || ((!paintSettings.isUseRealWidth()) && (paintSettings.isShowDirectionArrow()
    196                 && (!paintSettings.isShowRelevantDirectionsOnly() || w.hasDirectionKeys()))));
    197         boolean reversedDirection = w.reversedDirection();
     195        boolean showOrientation = !isModifier && selected && !paintSettings.isUseRealWidth();
     196        boolean showOneway = !isModifier && !selected &&
     197                !paintSettings.isUseRealWidth() &&
     198                paintSettings.isShowDirectionArrow() && w.hasDirectionKeys();
     199        boolean onewayReversed = w.reversedDirection();
    198200        /* head only takes over control if the option is true,
    199201        the direction should be shown at all and not only because it's selected */
    200         boolean showOnlyHeadArrowOnly = showDirection && !selected && paintSettings.isShowHeadArrowOnly();
     202        boolean showOnlyHeadArrowOnly = showOrientation && !selected && paintSettings.isShowHeadArrowOnly();
    201203        Node lastN;
    202204
    203205        Color myDashedColor = dashesBackground;
    204206        BasicStroke myLine = line, myDashLine = dashesLine;
    205         if (realWidth > 0 && paintSettings.isUseRealWidth() && !showDirection) {
     207        if (realWidth > 0 && paintSettings.isUseRealWidth() && !showOrientation) {
    206208            float myWidth = (int) (100 /  (float) (painter.getCircum() / realWidth));
    207209            if (myWidth < line.getLineWidth()) {
     
    216218        }
    217219
    218         Color markColor = null;
     220        Color myColor = color;
    219221        if(w.isHighlighted()) {
    220             markColor = paintSettings.getHighlightColor();
     222            myColor = paintSettings.getHighlightColor();
    221223        } else if (selected) {
    222             markColor = paintSettings.getSelectedColor(color.getAlpha());
     224            myColor = paintSettings.getSelectedColor(color.getAlpha());
    223225        } else if (member) {
    224             markColor = paintSettings.getRelationSelectedColor(color.getAlpha());
     226            myColor = paintSettings.getRelationSelectedColor(color.getAlpha());
    225227        } else if(w.isDisabled()) {
    226             markColor = paintSettings.getInactiveColor();
     228            myColor = paintSettings.getInactiveColor();
    227229            myDashedColor = paintSettings.getInactiveColor();
    228230        }
    229231
    230         painter.drawWay(w, markColor != null ? markColor : color, myLine, myDashLine, myDashedColor, text, showDirection,
    231                 selected ? false : reversedDirection, showOnlyHeadArrowOnly);
     232        painter.drawWay(w, myColor, myLine, myDashLine, myDashedColor, text, showOrientation,
     233                showOnlyHeadArrowOnly, showOneway, onewayReversed);
    232234
    233235        if(paintSettings.isShowOrderNumber()) {
Note: See TracChangeset for help on using the changeset viewer.