Index: trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java	(revision 14747)
+++ trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java	(revision 14748)
@@ -350,8 +350,9 @@
     @Override
     public void paint(MapViewGraphics graphics) {
-        List<WayPoint> visibleSegments = listVisibleSegments(graphics.getClipBounds().getLatLonBoundsBox());
+        Bounds clipBounds = graphics.getClipBounds().getLatLonBoundsBox();
+        List<WayPoint> visibleSegments = listVisibleSegments(clipBounds);
         if (!visibleSegments.isEmpty()) {
             readPreferences(layer.getName());
-            drawAll(graphics.getDefaultGraphics(), graphics.getMapView(), visibleSegments);
+            drawAll(graphics.getDefaultGraphics(), graphics.getMapView(), visibleSegments, clipBounds);
             if (graphics.getMapView().getLayerManager().getActiveLayer() == layer) {
                 drawColorBar(graphics.getDefaultGraphics(), graphics.getMapView());
@@ -411,6 +412,9 @@
      * @param mv              the meta data to current displayed area
      * @param visibleSegments segments visible in the current scope of mv
-     */
-    public void drawAll(Graphics2D g, MapView mv, List<WayPoint> visibleSegments) {
+     * @param clipBounds      the clipping rectangle for the current view
+     * @since 14748 : new parameter clipBounds
+     */
+
+    public void drawAll(Graphics2D g, MapView mv, List<WayPoint> visibleSegments, Bounds clipBounds) {
 
         final long timeStart = System.currentTimeMillis();
@@ -421,4 +425,7 @@
         if (!computeCacheInSync) { // don't compute if the cache is good
             calculateColors();
+            // update the WaiPoint.drawline attributes
+            visibleSegments.clear();
+            visibleSegments.addAll(listVisibleSegments(clipBounds));
         }
 
