Changeset 5378 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2012-07-28T21:41:33+02:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r5282 r5378 1171 1171 } 1172 1172 return rv; 1173 } 1174 1175 /** 1176 * Get selected primitives, while draw action is in progress. 1177 * 1178 * While drawing a way, technically the last node is selected. 1179 * This is inconvenient when the user tries to add tags to the 1180 * way using a keyboard shortcut. In that case, this method returns 1181 * the current way as selection, to work around this issue. 1182 * Otherwise the normal selection of the current data layer is returned. 1183 */ 1184 public Collection<OsmPrimitive> getInProgressSelection() { 1185 DataSet ds = getCurrentDataSet(); 1186 if (ds == null) return null; 1187 if (currentBaseNode != null && !ds.getSelected().isEmpty()) { 1188 Way continueFrom = getWayForNode(currentBaseNode); 1189 if (alt && continueFrom != null) { 1190 return Collections.<OsmPrimitive>singleton(continueFrom); 1191 } 1192 } 1193 return ds.getSelected(); 1173 1194 } 1174 1195 -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r5327 r5378 74 74 import org.openstreetmap.josm.Main; 75 75 import org.openstreetmap.josm.actions.JosmAction; 76 import org.openstreetmap.josm.actions.mapmode.DrawAction; 76 77 import org.openstreetmap.josm.actions.search.SearchAction.SearchMode; 77 78 import org.openstreetmap.josm.actions.search.SearchAction.SearchSetting; … … 462 463 */ 463 464 void add() { 464 DataSet ds = Main.main.getCurrentDataSet(); 465 if (ds == null) return; 466 Collection<OsmPrimitive> sel = ds.getSelected(); 465 Collection<OsmPrimitive> sel; 466 if (Main.map.mapMode instanceof DrawAction) { 467 sel = ((DrawAction) Main.map.mapMode).getInProgressSelection(); 468 } else { 469 DataSet ds = Main.main.getCurrentDataSet(); 470 if (ds == null) return; 471 sel = ds.getSelected(); 472 } 467 473 if (sel.isEmpty()) return; 468 474
Note:
See TracChangeset
for help on using the changeset viewer.