Merge branch 'master' of github.com:Ultimaker/Cura

This commit is contained in:
Ghostkeeper 2017-10-11 15:04:10 +02:00
commit 17a1d4c840
No known key found for this signature in database
GPG Key ID: C5F96EE2BC0F7E75
2 changed files with 14 additions and 19 deletions

View File

@ -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
} }
} }

View File

@ -31,10 +31,10 @@ fragment =
vec4 minorGridColor = mix(u_plateColor, u_gridColor1, 1.0 - min(minorLine, 1.0)); vec4 minorGridColor = mix(u_plateColor, u_gridColor1, 1.0 - min(minorLine, 1.0));
// Compute anti-aliased world-space major grid lines // Compute anti-aliased world-space major grid lines
vec2 majorGrid = abs(fract(coord / 10 - 0.5) - 0.5) / fwidth(coord / 10); vec2 majorGrid = abs(fract(coord / 10.0 - 0.5) - 0.5) / fwidth(coord / 10.0);
float majorLine = min(majorGrid.x, majorGrid.y); float majorLine = min(majorGrid.x, majorGrid.y);
frag_color = mix(minorGridColor, u_gridColor0, 1.0 - min(majorLine, 1.0)); gl_FragColor = mix(minorGridColor, u_gridColor0, 1.0 - min(majorLine, 1.0));
} }
vertex41core = vertex41core =
@ -72,7 +72,7 @@ fragment41core =
vec4 minorGridColor = mix(u_plateColor, u_gridColor1, 1.0 - min(minorLine, 1.0)); vec4 minorGridColor = mix(u_plateColor, u_gridColor1, 1.0 - min(minorLine, 1.0));
// Compute anti-aliased world-space major grid lines // Compute anti-aliased world-space major grid lines
vec2 majorGrid = abs(fract(coord / 10 - 0.5) - 0.5) / fwidth(coord / 10); vec2 majorGrid = abs(fract(coord / 10.0 - 0.5) - 0.5) / fwidth(coord / 10.0);
float majorLine = min(majorGrid.x, majorGrid.y); float majorLine = min(majorGrid.x, majorGrid.y);
frag_color = mix(minorGridColor, u_gridColor0, 1.0 - min(majorLine, 1.0)); frag_color = mix(minorGridColor, u_gridColor0, 1.0 - min(majorLine, 1.0));