Changeset 13987 in josm


Ignore:
Timestamp:
2018-06-30T12:01:59+02:00 (3 months ago)
Author:
Don-vip
Message:

see #16128 - don't display names while moving the map. Improves dragging performance greatly.

Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java

    r13810 r13987  
    6161    /** Preference: minimum space (displayed way length) to display segment numbers */
    6262    protected int segmentNumberSpace;
     63
     64    /** Performs slow operations by default. Can be disabled when fast partial rendering is required */
     65    protected boolean doSlowOperations;
    6366
    6467    /**
     
    243246        }
    244247    }
     248
     249    /**
     250     * Sets whether slow operations such as text rendering must be performed (true by default).
     251     * @param enable whether slow operations such as text rendering must be performed
     252     * @since 13987
     253     */
     254    public final void enableSlowOperations(boolean enable) {
     255        doSlowOperations = enable;
     256    }
    245257}
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r13922 r13987  
    15531553     */
    15541554    public boolean isShowNames() {
    1555         return showNames;
     1555        return showNames && doSlowOperations;
    15561556    }
    15571557
  • trunk/src/org/openstreetmap/josm/gui/MapMover.java

    r13761 r13987  
    2222import org.openstreetmap.josm.data.preferences.BooleanProperty;
    2323import org.openstreetmap.josm.gui.MapViewState.MapViewPoint;
     24import org.openstreetmap.josm.gui.layer.Layer;
    2425import org.openstreetmap.josm.spi.preferences.Config;
    2526import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     
    158159    }
    159160
    160     private boolean movementInProgress() {
     161    /**
     162     * Determines if a map move is in progress.
     163     * @return {@code true} if a map move is in progress
     164     * @since 13987
     165     */
     166    public boolean movementInProgress() {
    161167        return mousePosMoveStart != null;
    162168    }
     
    238244        nc.resetCursor(this);
    239245        mousePosMoveStart = null;
     246        MainApplication.getLayerManager().getLayers().forEach(Layer::invalidate);
    240247    }
    241248
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r13951 r13987  
    8080import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
    8181import org.openstreetmap.josm.data.osm.visitor.OsmPrimitiveVisitor;
     82import org.openstreetmap.josm.data.osm.visitor.paint.AbstractMapRenderer;
    8283import org.openstreetmap.josm.data.osm.visitor.paint.MapRendererFactory;
    83 import org.openstreetmap.josm.data.osm.visitor.paint.Rendering;
    8484import org.openstreetmap.josm.data.osm.visitor.paint.relations.MultipolygonCache;
    8585import org.openstreetmap.josm.data.preferences.IntegerProperty;
     
    493493        }
    494494
    495         Rendering painter = MapRendererFactory.getInstance().createActiveRenderer(g, mv, inactive);
     495        AbstractMapRenderer painter = MapRendererFactory.getInstance().createActiveRenderer(g, mv, inactive);
     496        painter.enableSlowOperations(mv.getMapMover() == null || !mv.getMapMover().movementInProgress());
    496497        painter.render(data, virtual, box);
    497498        MainApplication.getMap().conflictDialog.paintConflicts(g, mv);
Note: See TracChangeset for help on using the changeset viewer.