mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Updated DoubleSlider band. Added smart color selection for M600
This commit is contained in:
parent
c4a62819f4
commit
72852ffab5
6 changed files with 136 additions and 22 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue