Refactoring: fix GPX-track view

This commit is contained in:
Pieter Vander Vennet 2023-04-20 18:58:31 +02:00
parent 4172af6a72
commit c6e12fdd6b
23 changed files with 217 additions and 347 deletions

View file

@ -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
}
}