mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 10:39:00 +08:00
Merge pull request #1686 from fieldOfView/fix_material_nan
Fix NaN values on material print settings tab
This commit is contained in:
commit
865ab7135a
@ -273,17 +273,28 @@ TabView
|
|||||||
{
|
{
|
||||||
id: spinBox
|
id: spinBox
|
||||||
anchors.left: label.right
|
anchors.left: label.right
|
||||||
value: parseFloat(provider.properties.value);
|
value: {
|
||||||
width: base.secondColumnWidth;
|
if (!isNaN(parseFloat(materialPropertyProvider.properties.value)))
|
||||||
|
{
|
||||||
|
return parseFloat(materialPropertyProvider.properties.value);
|
||||||
|
}
|
||||||
|
if (!isNaN(parseFloat(machinePropertyProvider.properties.value)))
|
||||||
|
{
|
||||||
|
return parseFloat(machinePropertyProvider.properties.value);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
width: base.secondColumnWidth
|
||||||
readOnly: !base.editingEnabled
|
readOnly: !base.editingEnabled
|
||||||
suffix: model.unit
|
suffix: " " + model.unit
|
||||||
maximumValue: 99999
|
maximumValue: 99999
|
||||||
decimals: model.unit == "mm" ? 2 : 0
|
decimals: model.unit == "mm" ? 2 : 0
|
||||||
|
|
||||||
onEditingFinished: provider.setPropertyValue("value", value)
|
onEditingFinished: materialPropertyProvider.setPropertyValue("value", value)
|
||||||
}
|
}
|
||||||
|
|
||||||
UM.ContainerPropertyProvider { id: provider; containerId: base.containerId; watchedProperties: [ "value" ]; key: model.key }
|
UM.ContainerPropertyProvider { id: materialPropertyProvider; containerId: base.containerId; watchedProperties: [ "value" ]; key: model.key }
|
||||||
|
UM.ContainerPropertyProvider { id: machinePropertyProvider; containerId: Cura.MachineManager.activeDefinitionId; watchedProperties: [ "value" ]; key: model.key }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user