FIX: rendering as wireframe mode

jira: STUDIO-7952

Change-Id: I47d7498a9bb7d8220beab9f2fefb14c7de337e81
(cherry picked from commit 5f6cd474d5e8b48c63a8ecc60b2c119beccd6491)
This commit is contained in:
jun.zhang 2024-11-05 10:56:21 +08:00 committed by Lane.Wei
parent 8c396b3d9d
commit 672f81a3dc
2 changed files with 5 additions and 5 deletions

View File

@ -1330,9 +1330,8 @@ float TriangleSelectorPatch::gap_area = TriangleSelectorPatch::GapAreaMin;
void TriangleSelectorPatch::render(ImGuiWrapper* imgui) void TriangleSelectorPatch::render(ImGuiWrapper* imgui)
{ {
static bool last_show_wireframe = false; if (m_cached_wireframe_mode != wxGetApp().plater()->is_show_wireframe()) {
if (last_show_wireframe != wxGetApp().plater()->is_show_wireframe()) { m_cached_wireframe_mode = wxGetApp().plater()->is_show_wireframe();
last_show_wireframe = wxGetApp().plater()->is_show_wireframe();
m_update_render_data = true; m_update_render_data = true;
m_paint_changed = true; m_paint_changed = true;
} }
@ -1682,7 +1681,7 @@ void TriangleSelectorPatch::render(int triangle_indices_idx, int position_id, bo
if ((this->m_triangle_indices_sizes[triangle_indices_idx] > 0)&&(position_id != -1)) if ((this->m_triangle_indices_sizes[triangle_indices_idx] > 0)&&(position_id != -1))
glsafe(::glDisableVertexAttribArray(position_id)); glsafe(::glDisableVertexAttribArray(position_id));
if ((this->m_triangle_indices_sizes[triangle_indices_idx] > 0)&&show_wireframe) { if ((this->m_triangle_indices_sizes[triangle_indices_idx] > 0)&&show_wireframe) {
glsafe(::glEnableClientState(GL_COLOR_ARRAY)); glsafe(::glDisableClientState(GL_COLOR_ARRAY));
} }
if (this->m_triangle_indices_sizes[triangle_indices_idx] > 0) if (this->m_triangle_indices_sizes[triangle_indices_idx] > 0)
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, 0)); glsafe(::glBindBuffer(GL_ARRAY_BUFFER, 0));

View File

@ -198,6 +198,7 @@ protected:
std::vector<std::array<float, 4>> m_ebt_colors; std::vector<std::array<float, 4>> m_ebt_colors;
bool m_filter_state = false; bool m_filter_state = false;
bool m_cached_wireframe_mode = false;
private: private:
void update_render_data(); void update_render_data();