forked from MapComplete/MapComplete
Refactoring: fix GPX-track view
This commit is contained in:
parent
4172af6a72
commit
c6e12fdd6b
23 changed files with 217 additions and 347 deletions
29
Utils.ts
29
Utils.ts
|
@ -1415,4 +1415,33 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
) {
|
||||
return Math.abs(c0.r - c1.r) + Math.abs(c0.g - c1.g) + Math.abs(c0.b - c1.b)
|
||||
}
|
||||
|
||||
static SameObject(a: any, b: any) {
|
||||
if (a === b) {
|
||||
return true
|
||||
}
|
||||
if (a === undefined || a === null || b === null || b === undefined) {
|
||||
return false
|
||||
}
|
||||
if (typeof a === "object" && typeof b === "object") {
|
||||
for (const aKey in a) {
|
||||
if (!(aKey in b)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
for (const bKey in b) {
|
||||
if (!(bKey in a)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
for (const k in a) {
|
||||
if (!Utils.SameObject(a[k], b[k])) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue