mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06:00
Code cleanup for infill slider value binding - CURA-4438
This commit is contained in:
parent
e97bdc526b
commit
3db5787d5d
1 changed files with 11 additions and 16 deletions
|
@ -902,25 +902,20 @@ Item
|
||||||
{
|
{
|
||||||
target: infillDensity
|
target: infillDensity
|
||||||
property: "containerStackId"
|
property: "containerStackId"
|
||||||
value:
|
value: {
|
||||||
{
|
|
||||||
// associate this binding with Cura.MachineManager.activeMachineId in the beginning so this
|
|
||||||
// binding will be triggered when activeMachineId is changed too.
|
|
||||||
// Otherwise, if this value only depends on the extruderIds, it won't get updated when the
|
|
||||||
// machine gets changed.
|
|
||||||
var activeStackId = Cura.MachineManager.activeStackId;
|
|
||||||
|
|
||||||
if(machineExtruderCount.properties.value == 1)
|
// not settable per extruder or there only is global, so we must pick global
|
||||||
{
|
if (machineExtruderCount.properties.value == 1) {
|
||||||
//Not settable per extruder or there only is global, so we must pick global.
|
return Cura.MachineManager.activeStackId
|
||||||
return activeStackId;
|
|
||||||
}
|
}
|
||||||
if(infillInheritStackProvider.properties.limit_to_extruder != null && infillInheritStackProvider.properties.limit_to_extruder >= 0)
|
|
||||||
{
|
// return the ID of the extruder when the infill is limited to an extruder
|
||||||
//We have limit_to_extruder, so pick that stack.
|
if (infillInheritStackProvider.properties.limit_to_extruder != null && infillInheritStackProvider.properties.limit_to_extruder >= 0) {
|
||||||
return ExtruderManager.extruderIds[String(infillInheritStackProvider.properties.limit_to_extruder)];
|
return ExtruderManager.extruderIds[String(infillInheritStackProvider.properties.limit_to_extruder)]
|
||||||
}
|
}
|
||||||
return activeStackId;
|
|
||||||
|
// default to the global stack
|
||||||
|
return Cura.MachineManager.activeStackId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue