mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 19:59:12 +08:00
Code-style fixes
Contributes to CURA-5408
This commit is contained in:
parent
52f6037576
commit
a596c5a034
@ -515,7 +515,7 @@ TabView
|
|||||||
if(entry_name in materialPreferenceValues[material_guid] && materialPreferenceValues[material_guid][entry_name] == new_value)
|
if(entry_name in materialPreferenceValues[material_guid] && materialPreferenceValues[material_guid][entry_name] == new_value)
|
||||||
{
|
{
|
||||||
// value has not changed
|
// value has not changed
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
materialPreferenceValues[material_guid][entry_name] = new_value;
|
materialPreferenceValues[material_guid][entry_name] = new_value;
|
||||||
|
|
||||||
@ -531,34 +531,33 @@ TabView
|
|||||||
}
|
}
|
||||||
|
|
||||||
var material_weight = Cura.ContainerManager.getContainerMetaDataEntry(base.containerId, "properties", "weight");
|
var material_weight = Cura.ContainerManager.getContainerMetaDataEntry(base.containerId, "properties", "weight");
|
||||||
if(material_weight != undefined && material_weight != "")
|
return material_weight || 0;
|
||||||
{
|
|
||||||
return material_weight
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the display name of the material
|
// update the display name of the material
|
||||||
function updateMaterialDisplayName (old_name, new_name) {
|
function updateMaterialDisplayName (old_name, new_name)
|
||||||
|
{
|
||||||
// don't change when new name is the same
|
// don't change when new name is the same
|
||||||
if (old_name == new_name) {
|
if (old_name == new_name) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the values
|
// update the values
|
||||||
base.materialManager.setMaterialName(base.currentMaterialNode, new_name)
|
base.materialManager.setMaterialName(base.currentMaterialNode, new_name);
|
||||||
materialProperties.name = new_name
|
materialProperties.name = new_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the type of the material
|
// update the type of the material
|
||||||
function updateMaterialType (old_type, new_type) {
|
function updateMaterialType (old_type, new_type)
|
||||||
base.setMetaDataEntry("material", old_type, new_type)
|
{
|
||||||
materialProperties.material= new_type
|
base.setMetaDataEntry("material", old_type, new_type);
|
||||||
|
materialProperties.material= new_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the brand of the material
|
// update the brand of the material
|
||||||
function updateMaterialBrand (old_brand, new_brand) {
|
function updateMaterialBrand (old_brand, new_brand)
|
||||||
base.setMetaDataEntry("brand", old_brand, new_brand)
|
{
|
||||||
materialProperties.brand = new_brand
|
base.setMetaDataEntry("brand", old_brand, new_brand);
|
||||||
|
materialProperties.brand = new_brand;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user