Ticket #16128: 16128-disable-text-when-moving.patch
File 16128-disable-text-when-moving.patch, 6.1 KB (added by , 7 years ago) |
---|
-
src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java
61 61 /** Preference: minimum space (displayed way length) to display segment numbers */ 62 62 protected int segmentNumberSpace; 63 63 64 /** Performs slow operations by default. Can be disabled when fast partial rendering is required */ 65 protected boolean doSlowOperations; 66 64 67 /** 65 68 * <p>Creates an abstract paint visitor</p> 66 69 * … … 240 243 } 241 244 } 242 245 } 246 247 /** 248 * Sets whether slow operations such as text rendering must be performed (true by default). 249 * @param enable whether slow operations such as text rendering must be performed 250 * @since xxx 251 */ 252 public final void enableSlowOperations(boolean enable) { 253 doSlowOperations = enable; 254 } 243 255 } -
src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
557 557 * @param bs The text and it's alignment. 558 558 */ 559 559 public void drawBoxText(Node n, BoxTextElement bs) { 560 if (!isShowNames() || bs == null )560 if (!isShowNames() || bs == null || !doSlowOperations) 561 561 return; 562 562 563 563 MapViewPoint p = mapState.getPointFor(n); … … 1090 1090 * @since 11722 1091 1091 */ 1092 1092 public void drawText(OsmPrimitive osm, TextLabel text, PositionForAreaStrategy labelPositionStrategy) { 1093 if (!isShowNames() ) {1093 if (!isShowNames() || !doSlowOperations) { 1094 1094 return; 1095 1095 } 1096 1096 String name = text.getString(osm); -
src/org/openstreetmap/josm/gui/MapMover.java
18 18 import org.openstreetmap.gui.jmapviewer.JMapViewer; 19 19 import org.openstreetmap.josm.Main; 20 20 import org.openstreetmap.josm.actions.mapmode.SelectAction; 21 import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;22 import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;23 21 import org.openstreetmap.josm.data.coor.EastNorth; 24 22 import org.openstreetmap.josm.data.preferences.BooleanProperty; 25 23 import org.openstreetmap.josm.gui.MapViewState.MapViewPoint; 24 import org.openstreetmap.josm.gui.layer.Layer; 26 25 import org.openstreetmap.josm.spi.preferences.Config; 26 import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent; 27 import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener; 27 28 import org.openstreetmap.josm.tools.Destroyable; 28 29 import org.openstreetmap.josm.tools.Pair; 29 30 import org.openstreetmap.josm.tools.Shortcut; … … 157 158 registeredShortcuts.add(new Pair<>(action, shortcut)); 158 159 } 159 160 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 xxx 165 */ 166 public boolean movementInProgress() { 161 167 return mousePosMoveStart != null; 162 168 } 163 169 … … 237 243 } 238 244 nc.resetCursor(this); 239 245 mousePosMoveStart = null; 246 MainApplication.getLayerManager().getLayers().forEach(Layer::invalidate); 240 247 } 241 248 242 249 /** -
src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
63 63 import org.openstreetmap.josm.data.osm.DataIntegrityProblemException; 64 64 import org.openstreetmap.josm.data.osm.DataSelectionListener; 65 65 import org.openstreetmap.josm.data.osm.DataSet; 66 import org.openstreetmap.josm.data.osm.DownloadPolicy;67 import org.openstreetmap.josm.data.osm.UploadPolicy;68 66 import org.openstreetmap.josm.data.osm.DataSetMerger; 69 67 import org.openstreetmap.josm.data.osm.DatasetConsistencyTest; 68 import org.openstreetmap.josm.data.osm.DownloadPolicy; 70 69 import org.openstreetmap.josm.data.osm.HighlightUpdateListener; 71 70 import org.openstreetmap.josm.data.osm.IPrimitive; 72 71 import org.openstreetmap.josm.data.osm.Node; 73 72 import org.openstreetmap.josm.data.osm.OsmPrimitive; 74 73 import org.openstreetmap.josm.data.osm.OsmPrimitiveComparator; 75 74 import org.openstreetmap.josm.data.osm.Relation; 75 import org.openstreetmap.josm.data.osm.UploadPolicy; 76 76 import org.openstreetmap.josm.data.osm.Way; 77 77 import org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent; 78 78 import org.openstreetmap.josm.data.osm.event.DataSetListenerAdapter; 79 79 import org.openstreetmap.josm.data.osm.event.DataSetListenerAdapter.Listener; 80 80 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 81 81 import org.openstreetmap.josm.data.osm.visitor.OsmPrimitiveVisitor; 82 import org.openstreetmap.josm.data.osm.visitor.paint.AbstractMapRenderer; 82 83 import org.openstreetmap.josm.data.osm.visitor.paint.MapRendererFactory; 83 import org.openstreetmap.josm.data.osm.visitor.paint.Rendering;84 84 import org.openstreetmap.josm.data.osm.visitor.paint.relations.MultipolygonCache; 85 85 import org.openstreetmap.josm.data.preferences.IntegerProperty; 86 86 import org.openstreetmap.josm.data.preferences.NamedColorProperty; … … 490 490 g.fill(a); 491 491 } 492 492 493 Rendering painter = MapRendererFactory.getInstance().createActiveRenderer(g, mv, inactive); 493 AbstractMapRenderer painter = MapRendererFactory.getInstance().createActiveRenderer(g, mv, inactive); 494 painter.enableSlowOperations(mv.getMapMover() == null || !mv.getMapMover().movementInProgress()); 494 495 painter.render(data, virtual, box); 495 496 MainApplication.getMap().conflictDialog.paintConflicts(g, mv); 496 497 }