Updated DoubleSlider band. Added smart color selection for M600
This commit is contained in:
@@ -5296,13 +5296,13 @@ void GLCanvas3D::_load_gcode_extrusion_paths(const GCodePreviewData& preview_dat
|
||||
}
|
||||
case GCodePreviewData::Extrusion::ColorPrint:
|
||||
{
|
||||
// int color_cnt = (int)tool_colors.size() / 4;
|
||||
int color_cnt = (int)tool_colors.size() / 4;
|
||||
|
||||
// int val = int(value);
|
||||
// while (val >= color_cnt)
|
||||
// val -= color_cnt;
|
||||
|
||||
unsigned int val = unsigned int(value) >= INT_MAX ? tool_colors.size()*4 - 1 : value;
|
||||
int val = value > color_cnt ? color_cnt - 1 : value;
|
||||
|
||||
GCodePreviewData::Color color;
|
||||
::memcpy((void*)color.rgba, (const void*)(tool_colors.data() + val * 4), 4 * sizeof(float));
|
||||
|
||||
Reference in New Issue
Block a user