Index: trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java	(revision 12453)
+++ trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java	(revision 12455)
@@ -655,12 +655,9 @@
         }
 
-        double startOffset = phase % repeat;
-        if (startOffset < 0) {
-            startOffset += repeat;
-        }
+        double startOffset = computeStartOffset(phase, repeat);
 
         BufferedImage image = pattern.getImage(disabled);
 
-        path.visitClippedLine(startOffset, repeat, (inLineOffset, start, end, startIsOldEnd) -> {
+        path.visitClippedLine(repeat, (inLineOffset, start, end, startIsOldEnd) -> {
             final double segmentLength = start.distanceToInView(end);
             if (segmentLength < 0.1) {
@@ -679,5 +676,5 @@
 
             // The start of the next image
-            double imageStart = -(inLineOffset % repeat);
+            double imageStart = -((inLineOffset + startOffset) % repeat);
 
             while (imageStart < segmentLength) {
@@ -691,4 +688,12 @@
             g.setTransform(saveTransform);
         });
+    }
+
+    private static double computeStartOffset(double phase, final double repeat) {
+        double startOffset = phase % repeat;
+        if (startOffset < 0) {
+            startOffset += repeat;
+        }
+        return startOffset;
     }
 
@@ -1291,5 +1296,5 @@
             double interval = 60;
 
-            path.visitClippedLine(0, 60, (inLineOffset, start, end, startIsOldEnd) -> {
+            path.visitClippedLine(60, (inLineOffset, start, end, startIsOldEnd) -> {
                 double segmentLength = start.distanceToInView(end);
                 if (segmentLength > 0.001) {
Index: trunk/src/org/openstreetmap/josm/gui/draw/MapViewPath.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/draw/MapViewPath.java	(revision 12453)
+++ trunk/src/org/openstreetmap/josm/gui/draw/MapViewPath.java	(revision 12455)
@@ -254,7 +254,7 @@
                 length += f;
             }
-            return visitClippedLine(((BasicStroke) stroke).getDashPhase(), length, consumer);
+            return visitClippedLine(length, consumer);
         } else {
-            return visitClippedLine(0, 0, consumer);
+            return visitClippedLine(0, consumer);
         }
     }
@@ -263,12 +263,11 @@
      * Visits all straight segments of this path. The segments are clamped to the view.
      * If they are clamped, the start points are aligned with the pattern.
-     * @param strokeOffset The initial offset of the pattern
-     * @param strokeLength The dash pattern length. 0 to use no pattern.
+     * @param strokeLength The dash pattern length. 0 to use no pattern. Only segments of this length will be removed from the line.
      * @param consumer The consumer to call for each segment
      * @return false if visiting the path failed because there e.g. were non-straight segments.
      * @since 11147
      */
-    public boolean visitClippedLine(double strokeOffset, double strokeLength, PathSegmentConsumer consumer) {
-        return new ClampingPathVisitor(state.getViewClipRectangle(), strokeOffset, strokeLength, consumer)
+    public boolean visitClippedLine(double strokeLength, PathSegmentConsumer consumer) {
+        return new ClampingPathVisitor(state.getViewClipRectangle(), strokeLength, consumer)
             .visit(this);
     }
@@ -400,11 +399,9 @@
          * Create a new {@link ClampingPathVisitor}
          * @param clip View clip rectangle
-         * @param strokeOffset Initial stroke offset
          * @param strokeLength Total length of a stroke sequence
          * @param consumer The consumer to notify of the path segments.
          */
-        ClampingPathVisitor(MapViewRectangle clip, double strokeOffset, double strokeLength, PathSegmentConsumer consumer) {
+        ClampingPathVisitor(MapViewRectangle clip, double strokeLength, PathSegmentConsumer consumer) {
             this.clip = clip;
-            this.strokeProgress = Math.min(strokeLength - strokeOffset, 0);
             this.strokeLength = strokeLength;
             this.consumer = consumer;
