FIX:Imgui's StyleVar not pop according to PushStyleVar

Jira: STUDIO-5000
Change-Id: I4bdafb41404651a19a211e2e1eec78169ff8b9f3
This commit is contained in:
zhou.xu 2023-10-30 17:10:12 +08:00 committed by Lane.Wei
parent 7a29a49f9e
commit 295c40709f
2 changed files with 2 additions and 1 deletions

View File

@ -2000,6 +2000,7 @@ void GLGizmoAdvancedCut::render_cut_plane_input_window(float x, float y, float b
m_imgui->disabled_end(); m_imgui->disabled_end();
ImGui::SameLine(); ImGui::SameLine();
const bool reset_clicked = m_imgui->button(_L("Reset")); const bool reset_clicked = m_imgui->button(_L("Reset"));
ImGui::PopStyleVar(2);
if (reset_clicked) { reset_all(); } if (reset_clicked) { reset_all(); }
} }

View File

@ -140,11 +140,11 @@ bool MeshClipper::has_valid_contour() const
} }
std::vector<Vec3d> MeshClipper::point_per_contour() const { std::vector<Vec3d> MeshClipper::point_per_contour() const {
assert(m_result);
std::vector<Vec3d> out; std::vector<Vec3d> out;
if (m_result == std::nullopt) { if (m_result == std::nullopt) {
return out; return out;
} }
assert(m_result);
for (const CutIsland &isl : m_result->cut_islands) { for (const CutIsland &isl : m_result->cut_islands) {
assert(isl.expoly.contour.size() > 2); assert(isl.expoly.contour.size() > 2);
// Now return a point lying inside the contour but not in a hole. // Now return a point lying inside the contour but not in a hole.