only compare properties which exist for both objects in 'numeric comparer'

note: this is attempt to quick-n-dirty workaround weird issue with having colors informaiton inside 'dimensions' in the latest master

example:

 "blue": 0.2367398738861084,
   "green": 0.08945406973361969,
   "red": 0.25246158242225647,
   "x": 0.25246158242225647,
   "y": 0.08945406973361969,
   "z": 0.2367398738861084
This commit is contained in:
Alexander Ivash 2018-07-06 22:56:58 +03:00
parent 67fb8af87c
commit 536395d199

View file

@ -121,11 +121,14 @@ ListModel {
return false;
for(var prop in o1) {
var v1 = o1[prop];
var v2 = o2[prop];
if(o1.hasOwnProperty(prop) && o2.hasOwnProperty(prop)) {
var v1 = o1[prop];
var v2 = o2[prop];
if(v1 !== v2 && Math.round(v1 * 1000) != Math.round(v2 * 1000))
return false;
if(v1 !== v2 && Math.round(v1 * 1000) != Math.round(v2 * 1000))
return false;
}
}
return true;