FIX: load_from_svg_file_change_color() supports 8bit colour values
JIRA: nojira Change-Id: I72e68bd9cb547064736d130205074da0e7eabd60
This commit is contained in:
parent
02a38db9c4
commit
8bdac292a0
|
@ -549,8 +549,10 @@ bool BitmapCache::load_from_svg_file_change_color(const std::string &filename, u
|
||||||
if (image == nullptr) {
|
if (image == nullptr) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
char temp_color[8];
|
||||||
unsigned int change_color = nsvg__parseColorHex(hexColor);
|
strncpy(temp_color, hexColor, 7);
|
||||||
|
temp_color[7] = '\0';
|
||||||
|
unsigned int change_color = nsvg__parseColorHex(temp_color);
|
||||||
change_color |= (unsigned int) (1.0f * 255) << 24; // opacity
|
change_color |= (unsigned int) (1.0f * 255) << 24; // opacity
|
||||||
unsigned int green_color = 4282560000;
|
unsigned int green_color = 4282560000;
|
||||||
for (NSVGshape* shape = image->shapes; shape != nullptr; shape = shape->next) {
|
for (NSVGshape* shape = image->shapes; shape != nullptr; shape = shape->next) {
|
||||||
|
|
|
@ -4629,7 +4629,7 @@ void GCodeViewer::render_legend_color_arr_recommen(float window_padding)
|
||||||
float line_height = ImGui::GetFrameHeight();
|
float line_height = ImGui::GetFrameHeight();
|
||||||
int AMS_filament_max_num = std::max(m_left_extruder_filament.size(), m_right_extruder_filament.size());
|
int AMS_filament_max_num = std::max(m_left_extruder_filament.size(), m_right_extruder_filament.size());
|
||||||
float three_words_width = imgui.calc_text_size("ABC").x;
|
float three_words_width = imgui.calc_text_size("ABC").x;
|
||||||
float AMS_container_height = (std::ceil(AMS_filament_max_num / 4.0f) * (three_words_width * 1.5f + line_height) + (line_height * 4));
|
float AMS_container_height = (std::ceil(AMS_filament_max_num / 4.0f) * (three_words_width * 1.6f + line_height) + (line_height * 5));
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(window_padding * 3, 0));
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(window_padding * 3, 0));
|
||||||
ImGui::BeginChild("#AMS", ImVec2(0, AMS_container_height), false, ImGuiWindowFlags_AlwaysUseWindowPadding);
|
ImGui::BeginChild("#AMS", ImVec2(0, AMS_container_height), false, ImGuiWindowFlags_AlwaysUseWindowPadding);
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue