Changeset 33294 in osm for applications/editors


Ignore:
Timestamp:
2017-05-08T21:33:49+02:00 (8 years ago)
Author:
donvip
Message:

fix #josm14757 - avoid "sun.dc.pr.PRError: setDashT4: invalid dash transformation (singular)" when drawing dashed lines

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

Legend:

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

    r33085 r33294  
    179179    }
    180180
    181     private final class Corner {
     181    private static final class Corner {
    182182        final double x1;
    183183        final double y1;
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/RoadGui.java

    r33085 r33294  
    2323import java.awt.Shape;
    2424import java.awt.Stroke;
     25import java.awt.geom.AffineTransform;
    2526import java.awt.geom.Area;
    2627import java.awt.geom.Ellipse2D;
     
    727728        g2d.draw(lines);
    728729
    729         // g2d.setColor(new Color(32, 128, 192));
    730         g2d.setColor(Color.WHITE);
    731         g2d.setStroke(dashedStroke);
    732         for (Path p : linePaths) {
    733             lines.reset();
    734             lines.append(p.getIterator(), false);
    735             g2d.draw(lines);
    736         }
    737         g2d.setStroke(regularStroke);
     730        AffineTransform at = g2d.getTransform();
     731        // Draw dashed lines only if the affine transform supports it (see #14757)
     732        if (!Double.isNaN(at.getTranslateX()) && !Double.isNaN(at.getTranslateY())) {
     733            g2d.setColor(Color.WHITE);
     734            g2d.setStroke(dashedStroke);
     735            for (Path p : linePaths) {
     736                lines.reset();
     737                lines.append(p.getIterator(), false);
     738                g2d.draw(lines);
     739            }
     740            g2d.setStroke(regularStroke);
     741        }
    738742
    739743        // g2d.setColor(new Color(32, 128, 192));
Note: See TracChangeset for help on using the changeset viewer.