mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-17 22:24:49 +02:00
only drop restrictions from FROM towards VIA when adding new only
partially adresses bugs in #4968: * doesn't crash anymore in complex situations (short FROM ways where both ends connect to a TO way) * adding a only-restriction at one end of a short FROM doesn't delete restrictions on the other end of the same FROM anymore
This commit is contained in:
@@ -359,13 +359,13 @@ export function uiFieldRestrictions(field, context) {
|
||||
datumOnly.only = true;
|
||||
restrictionType = restrictionType.replace(/^no/, 'only');
|
||||
|
||||
// Adding an ONLY restriction should destroy all other direct restrictions from the FROM.
|
||||
// Adding an ONLY restriction should destroy all other direct restrictions from the FROM towards the VIA.
|
||||
// We will remember them in _oldTurns, and restore them if the user clicks again.
|
||||
turns = _intersection.turns(_fromWayID, 2);
|
||||
extraActions = [];
|
||||
_oldTurns = [];
|
||||
for (i = 0; i < turns.length; i++) {
|
||||
if (turns[i].direct) {
|
||||
if (turns[i].direct && turns[i].path[1] === datum.path[1]) {
|
||||
turns[i].restrictionType = osmInferRestriction(vgraph, turns[i], projection);
|
||||
_oldTurns.push(turns[i]);
|
||||
extraActions.push(actionUnrestrictTurn(turns[i]));
|
||||
|
||||
Reference in New Issue
Block a user