Ignore:
Timestamp:
2019-03-20T20:27:12+01:00 (5 years ago)
Author:
donvip
Message:

fix #josm16568 - Turn lanes UI not working properly in smaller roads/lanes and junctions (patch by abhilekhsingh041992)

Location:
applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/GuiContainer.java

    r34566 r34925  
    6262        this.mc = mc;
    6363        this.translation = new Point2D.Double(-origin.getX(), -origin.getY());
    64         this.mpp = 0.2;
     64        this.mpp = 0.5;
    6565        this.scale = mpsu / mpp;
    66         this.laneWidth = 2 / mpp;
    67 
    68         this.connectionStroke = new BasicStroke((float) (laneWidth / 4), BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
     66
     67        this.laneWidth = 1.0 / mpp;
     68
     69        this.connectionStroke = new BasicStroke((float) (laneWidth / 5), BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
    6970
    7071        for (Junction j : mc.getPrimaryJunctions()) {
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/JunctionGui.java

    r33294 r34925  
    387387        final double a = wide ? max(0, delta - (PI + 2 * MAX_ANGLE)) : delta;
    388388
    389         final double cpf1 = cpf(a, container.getLaneWidth() / 2 + (wide ? right.roadGui.getWidth(right.roadEnd) : 0));
    390         final double cpf2 = cpf(a, container.getLaneWidth() / 2 + (wide ? left.roadGui.getWidth(left.roadEnd) : 0));
     389        final double cpf1 = cpf(a, container.getLaneWidth() / 5 + (wide ? right.roadGui.getWidth(right.roadEnd) : 0));
     390        final double cpf2 = cpf(a, container.getLaneWidth() / 5 + (wide ? left.roadGui.getWidth(left.roadEnd) : 0));
    391391
    392392        final Point2D c1 = relativePoint(rightCurb.getP1(), cpf1, right.angle + PI);
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/JunctionPane.java

    r33085 r34925  
    454454        for (JunctionGui j : container.getJunctions()) {
    455455            addAllInteractives(j.paint(g2d));
    456             dot(g2d, new Point2D.Double(j.x, j.y), container.getLaneWidth() / 5);
     456            dot(g2d, new Point2D.Double(j.x, j.y), container.getLaneWidth() / 10);
    457457        }
    458458    }
Note: See TracChangeset for help on using the changeset viewer.