Changeset 3789 in josm


Ignore:
Timestamp:
2011-01-15T20:28:49+01:00 (14 years ago)
Author:
bastiK
Message:

see #5109 (patch by Petr Dlouhy) - relation analysis; fix left-right and connection issue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java

    r3788 r3789  
    952952        }
    953953
    954         int firstGroupIdx=0;
     954        firstGroupIdx=0;
    955955
    956956        lastForwardWay = UNCONNECTED;
     
    984984                    wct.isOnewayHead = true;
    985985                    lastForwardWay = i-1;
    986                     lastBackwardWay = i;
     986                    lastBackwardWay = i-1;
    987987                    onewayBeginning = true;
    988988                }
     
    10171017
    10181018            if(!wct.linkPrev) {
    1019                 if(i > 0) makeLoopIfNeeded(con, i-1, firstGroupIdx);
     1019                if(i > 0) makeLoopIfNeeded(con, i-1);
    10201020                firstGroupIdx = i;
    10211021            }
    10221022        }
    1023         makeLoopIfNeeded(con, members.size()-1, firstGroupIdx);
     1023        makeLoopIfNeeded(con, members.size()-1);
    10241024        connectionType = con;
    10251025        //        for (int i=0; i<con.size(); ++i) {
     
    10561056    }
    10571057
    1058     private void makeLoopIfNeeded(final List<WayConnectionType> con, final int i, final int firstGroupIdx) {
     1058    int firstGroupIdx;
     1059    private void makeLoopIfNeeded(final List<WayConnectionType> con, final int i) {
    10591060        boolean loop;
    10601061        if (i == firstGroupIdx) { //is primitive loop
     
    10921093        Direction dirBW = NONE;
    10931094        if(onewayBeginning) {
    1094             if(lastBackwardWay != i)
    1095                 dirBW = determineDirection(lastBackwardWay, reverse(con.get(lastBackwardWay).direction), i, true);
     1095            if(lastBackwardWay < 0)
     1096                dirBW = determineDirection(firstGroupIdx, reverse(con.get(firstGroupIdx).direction), i, true);
     1097            else
     1098                dirBW = determineDirection(lastBackwardWay, con.get(lastBackwardWay).direction, i, true);
     1099
    10961100            if(dirBW != NONE)
    10971101                onewayBeginning = false;
     
    11171121                    wct.isOnewayHead = true;
    11181122                    lastForwardWay = i-1;
    1119                     lastBackwardWay = i;
     1123                    lastBackwardWay = i-1;
    11201124                } else {
    11211125                    lastForwardWay = UNCONNECTED;
Note: See TracChangeset for help on using the changeset viewer.