Changeset 14748 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2019-01-28T10:05:18+01:00 (6 years ago)
Author:
GerdP
Message:

fix #17263: GpxLayer sometimes shows "ghost lines"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java

    r14456 r14748  
    350350    @Override
    351351    public void paint(MapViewGraphics graphics) {
    352         List<WayPoint> visibleSegments = listVisibleSegments(graphics.getClipBounds().getLatLonBoundsBox());
     352        Bounds clipBounds = graphics.getClipBounds().getLatLonBoundsBox();
     353        List<WayPoint> visibleSegments = listVisibleSegments(clipBounds);
    353354        if (!visibleSegments.isEmpty()) {
    354355            readPreferences(layer.getName());
    355             drawAll(graphics.getDefaultGraphics(), graphics.getMapView(), visibleSegments);
     356            drawAll(graphics.getDefaultGraphics(), graphics.getMapView(), visibleSegments, clipBounds);
    356357            if (graphics.getMapView().getLayerManager().getActiveLayer() == layer) {
    357358                drawColorBar(graphics.getDefaultGraphics(), graphics.getMapView());
     
    411412     * @param mv              the meta data to current displayed area
    412413     * @param visibleSegments segments visible in the current scope of mv
    413      */
    414     public void drawAll(Graphics2D g, MapView mv, List<WayPoint> visibleSegments) {
     414     * @param clipBounds      the clipping rectangle for the current view
     415     * @since 14748 : new parameter clipBounds
     416     */
     417
     418    public void drawAll(Graphics2D g, MapView mv, List<WayPoint> visibleSegments, Bounds clipBounds) {
    415419
    416420        final long timeStart = System.currentTimeMillis();
     
    421425        if (!computeCacheInSync) { // don't compute if the cache is good
    422426            calculateColors();
     427            // update the WaiPoint.drawline attributes
     428            visibleSegments.clear();
     429            visibleSegments.addAll(listVisibleSegments(clipBounds));
    423430        }
    424431
Note: See TracChangeset for help on using the changeset viewer.