mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Make UI changes in the Simulation View for adapting the color gradient
in the Feedrate color scheme. Due to the travel speed is normally very high compared with the other speeds in the model, the gradient is now gradual instead of linear in order to show more changes in the low values and less changes in the high values. Adapt also the button styles and themes' colors. Set the play/pause button to the left and reduce the size.
This commit is contained in:
parent
d0c1569da6
commit
fa00a17c78
8 changed files with 257 additions and 184 deletions
|
@ -38,12 +38,25 @@ vertex41core =
|
|||
out highp vec3 f_vertex;
|
||||
out highp vec3 f_normal;
|
||||
|
||||
vec4 gradientColor(float abs_value, float min_value, float max_value)
|
||||
vec4 feedrateGradientColor(float abs_value, float min_value, float max_value)
|
||||
{
|
||||
float value = (abs_value - min_value)/(max_value - min_value);
|
||||
float red = value;
|
||||
float green = 1-abs(1-4*value);
|
||||
if (value > 0.375)
|
||||
{
|
||||
green = 0.5;
|
||||
}
|
||||
float blue = max(1-4*value, 0);
|
||||
return vec4(red, green, blue, 1.0);
|
||||
}
|
||||
|
||||
vec4 layerThicknessGradientColor(float abs_value, float min_value, float max_value)
|
||||
{
|
||||
float value = (abs_value - min_value)/(max_value - min_value);
|
||||
float red = max(2*value-1, 0);
|
||||
float green = 1-abs(1-2*value);
|
||||
float blue = 1-value;
|
||||
float blue = max(1-2*value, 0);
|
||||
return vec4(red, green, blue, 1.0);
|
||||
}
|
||||
|
||||
|
@ -64,10 +77,10 @@ vertex41core =
|
|||
v_color = a_color;
|
||||
break;
|
||||
case 2: // "Feedrate"
|
||||
v_color = gradientColor(a_feedrate, u_min_feedrate, u_max_feedrate);
|
||||
v_color = feedrateGradientColor(a_feedrate, u_min_feedrate, u_max_feedrate);
|
||||
break;
|
||||
case 3: // "Layer thickness"
|
||||
v_color = gradientColor(a_line_dim.y, u_min_thickness, u_max_thickness);
|
||||
v_color = layerThicknessGradientColor(a_line_dim.y, u_min_thickness, u_max_thickness);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue