mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 03:08:00 +02:00
fix fallback properties
This commit is contained in:
parent
b3e0d51260
commit
5c1972e3f4
1 changed files with 15 additions and 4 deletions
|
@ -2935,7 +2935,21 @@ function loaded() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!propertyValue && propertyData.fallbackProperty !== undefined) {
|
let isPropertyNotNumber = false;
|
||||||
|
switch (propertyData.type) {
|
||||||
|
case 'number':
|
||||||
|
case 'slider':
|
||||||
|
isPropertyNotNumber = isNaN(propertyValue) || propertyValue === null;
|
||||||
|
break;
|
||||||
|
case 'vec3':
|
||||||
|
case 'vec2':
|
||||||
|
isPropertyNotNumber = isNaN(propertyValue.x) || propertyValue.x === null;
|
||||||
|
break;
|
||||||
|
case 'color':
|
||||||
|
isPropertyNotNumber = isNaN(propertyValue.red) || propertyValue.red === null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (isPropertyNotNumber && propertyData.fallbackProperty !== undefined) {
|
||||||
propertyValue = getPropertyValue(propertyData.fallbackProperty);
|
propertyValue = getPropertyValue(propertyData.fallbackProperty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3000,9 +3014,6 @@ function loaded() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'color': {
|
case 'color': {
|
||||||
if (!propertyValue.red && propertyData.fallbackProperty !== undefined) {
|
|
||||||
propertyValue = getPropertyValue(propertyData.fallbackProperty);
|
|
||||||
}
|
|
||||||
property.elColorPicker.style.backgroundColor = "rgb(" + propertyValue.red + "," +
|
property.elColorPicker.style.backgroundColor = "rgb(" + propertyValue.red + "," +
|
||||||
propertyValue.green + "," +
|
propertyValue.green + "," +
|
||||||
propertyValue.blue + ")";
|
propertyValue.blue + ")";
|
||||||
|
|
Loading…
Reference in a new issue