mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-31 04:09:33 +02:00
Don't rm old preset tags post merge, but do rm area=yes when setting preset
(closes #4114)
This commit is contained in:
@@ -12,17 +12,15 @@ import { modeSelect } from '../modes';
|
||||
|
||||
export function operationMerge(selectedIDs, context) {
|
||||
|
||||
function updatePresetTags(oldGraph, newGraph, ids) {
|
||||
function updatePresetTags(newGraph, ids) {
|
||||
var id = ids[0],
|
||||
oldEntity = oldGraph.hasEntity(id),
|
||||
newEntity = newGraph.hasEntity(id);
|
||||
|
||||
if (!oldEntity || !newEntity) return;
|
||||
if (!newEntity) return;
|
||||
|
||||
var oldPreset = context.presets().match(oldEntity, oldGraph),
|
||||
newPreset = context.presets().match(newEntity, newGraph);
|
||||
var newPreset = context.presets().match(newEntity, newGraph);
|
||||
|
||||
context.replace(actionChangePreset(id, oldPreset, newPreset), operation.annotation());
|
||||
context.replace(actionChangePreset(id, null, newPreset), operation.annotation());
|
||||
}
|
||||
|
||||
|
||||
@@ -50,9 +48,9 @@ export function operationMerge(selectedIDs, context) {
|
||||
return entity && entity.type !== 'node';
|
||||
});
|
||||
|
||||
// if we merged tags, rematch preset and update tags if necessary (#3851)
|
||||
// if we merged tags, rematch preset to update tags if necessary (#3851)
|
||||
if (action === merge) {
|
||||
updatePresetTags(origGraph, context.graph(), ids);
|
||||
updatePresetTags(context.graph(), ids);
|
||||
}
|
||||
|
||||
context.enter(modeSelect(context, ids));
|
||||
|
||||
@@ -125,6 +125,7 @@ export function presetPreset(id, preset, fields) {
|
||||
// This is necessary if the geometry is already an area (e.g. user drew an area) AND any of:
|
||||
// 1. chosen preset could be either an area or a line (`barrier=city_wall`)
|
||||
// 2. chosen preset doesn't have a key in areaKeys (`railway=station`)
|
||||
delete tags.area;
|
||||
if (geometry === 'area') {
|
||||
var needsAreaTag = true;
|
||||
if (preset.geometry.indexOf('line') === -1) {
|
||||
|
||||
Reference in New Issue
Block a user