Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/imgui/imgui_widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,13 @@ void ImGui::TextAlignCenter(const char *label)
ImGui::SameLine(ImGui::GetCursorPos().x + (item_width - font_size) / 2);

if ('X' == *label)
ImGui::TextColored(ImVec4(1.0, 0.0, 0.0, 1.0),label);
ImGui::TextColored(ImVec4(1.0, 0.0, 0.0, 1.0), "%s", label);
else if ('Y' == *label)
ImGui::TextColored(ImVec4(0.0, 0.6, 0.2, 1.0),label);
ImGui::TextColored(ImVec4(0.0, 0.6, 0.2, 1.0), "%s", label);
else if ('Z' == *label)
ImGui::TextColored(ImVec4(0.0, 0.0, 1.0, 1.0),label);
ImGui::TextColored(ImVec4(0.0, 0.0, 1.0, 1.0), "%s", label);
else
ImGui::Text(label);
ImGui::Text("%s", label);
}

void ImGui::TextV(const char* fmt, va_list args)
Expand Down
17 changes: 10 additions & 7 deletions src/slic3r/GUI/GLCanvas3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ void GLCanvas3D::LayersEditing::render_variable_layer_height_dialog(const GLCanv

ImGui::PushItemWidth(max_text_size);
ImGui::AlignTextToFramePadding();
ImGui::Text(quality_speed_text.c_str());
ImGui::Text("%s", quality_speed_text.c_str());

ImGui::SameLine(max_text_size + ImGui::GetStyle().ItemSpacing.x + ImGui::GetStyle().WindowPadding.x);

Expand Down Expand Up @@ -328,7 +328,7 @@ void GLCanvas3D::LayersEditing::render_variable_layer_height_dialog(const GLCanv

ImGui::PushItemWidth(max_text_size);
ImGui::AlignTextToFramePadding();
ImGui::Text(smooth_text.c_str());
ImGui::Text("%s", smooth_text.c_str());

ImGui::SameLine(max_text_size + ImGui::GetStyle().ItemSpacing.x + ImGui::GetStyle().WindowPadding.x);

Expand Down Expand Up @@ -10797,7 +10797,10 @@ void GLCanvas3D::_render_imgui_select_plate_toolbar()

// draw text
ImVec2 text_start_pos = ImVec2(start_pos.x + 10.0f, start_pos.y + 8.0f);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-security"
ImGui::RenderText(text_start_pos, std::to_string(i + 1).c_str());
#pragma GCC diagnostic pop

ImGui::PopID();
}
Expand Down Expand Up @@ -11134,18 +11137,18 @@ void GLCanvas3D::_render_paint_toolbar() const
ImVec2 number_label_size = ImGui::CalcTextSize(std::to_string(i + 1).c_str());
ImGui::SetCursorPosY(cursor_y + text_offset_y);
ImGui::SetCursorPosX(spacing + i * (spacing + button_size.x) + (button_size.x - number_label_size.x) / 2);
ImGui::TextColored(text_color, std::to_string(i + 1).c_str());
ImGui::TextColored(text_color, "%d", i + 1);
imgui.pop_bold_font();

ImVec2 filament_first_line_label_size = ImGui::CalcTextSize(filament_text_first_line[i].c_str());
ImGui::SetCursorPosY(cursor_y + text_offset_y + number_label_size.y);
ImGui::SetCursorPosX(spacing + i * (spacing + button_size.x) + (button_size.x - filament_first_line_label_size.x) / 2);
ImGui::TextColored(text_color, filament_text_first_line[i].c_str());
ImGui::TextColored(text_color, "%s", filament_text_first_line[i].c_str());

ImVec2 filament_second_line_label_size = ImGui::CalcTextSize(filament_text_second_line[i].c_str());
ImGui::SetCursorPosY(cursor_y + text_offset_y + number_label_size.y + filament_first_line_label_size.y);
ImGui::SetCursorPosX(spacing + i * (spacing + button_size.x) + (button_size.x - filament_second_line_label_size.x) / 2);
ImGui::TextColored(text_color, filament_text_second_line[i].c_str());
ImGui::TextColored(text_color, "%s", filament_text_second_line[i].c_str());
}

if (ImGui::GetWindowWidth() == constraint_window_width) {
Expand Down Expand Up @@ -11298,10 +11301,10 @@ void GLCanvas3D::_render_assemble_info() const
double size1 = m_selection.get_bounding_box().size()(1);
double size2 = m_selection.get_bounding_box().size()(2);
if (!m_selection.is_empty()) {
ImGui::Text(_L("Volume:").ToUTF8());
ImGui::Text("Volume:");
ImGui::SameLine(caption_max);
ImGui::Text("%.2f", size0 * size1 * size2);
ImGui::Text(_L("Size:").ToUTF8());
ImGui::Text("Size:");
ImGui::SameLine(caption_max);
ImGui::Text("%.2f x %.2f x %.2f", size0, size1, size2);
}
Expand Down