mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
Return shallow clones of features, because the hashes may change
If we return the original feature, and then change the hash later as the feature merges with another, d3 won't exit/enter because it is joining on the new hash, not the originally hash.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import _clone from 'lodash-es/clone';
|
||||
import _find from 'lodash-es/find';
|
||||
import _isEqual from 'lodash-es/isEqual';
|
||||
import _forEach from 'lodash-es/forEach';
|
||||
@@ -172,7 +173,10 @@ export default {
|
||||
var hash = feature.__featurehash__;
|
||||
if (seen[hash]) continue;
|
||||
seen[hash] = true;
|
||||
results.push(feature);
|
||||
|
||||
// return a shallow clone, because the hash may change
|
||||
// later if this feature gets merged with another
|
||||
results.push(_clone(feature));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user