mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +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;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -3000,9 +3014,6 @@ function loaded() {
|
|||
break;
|
||||
}
|
||||
case 'color': {
|
||||
if (!propertyValue.red && propertyData.fallbackProperty !== undefined) {
|
||||
propertyValue = getPropertyValue(propertyData.fallbackProperty);
|
||||
}
|
||||
property.elColorPicker.style.backgroundColor = "rgb(" + propertyValue.red + "," +
|
||||
propertyValue.green + "," +
|
||||
propertyValue.blue + ")";
|
||||
|
|
Loading…
Reference in a new issue