Fixed rendering undo/redo toolbar arrow.

This commit is contained in:
David Kocik 2021-09-23 09:56:08 +02:00
parent bc4650d174
commit b382ac8541
2 changed files with 27 additions and 3 deletions

View file

@ -1143,6 +1143,10 @@ void GLToolbar::render_background(float left, float top, float right, float bott
void GLToolbar::render_arrow(const GLCanvas3D& parent, GLToolbarItem* highlighted_item)
{
// arrow texture not initialized
if (m_arrow_texture.texture.get_id() == 0)
return;
float inv_zoom = (float)wxGetApp().plater()->get_camera().get_inv_zoom();
float factor = inv_zoom * m_layout.scale;
@ -1157,6 +1161,7 @@ void GLToolbar::render_arrow(const GLCanvas3D& parent, GLToolbarItem* highlighte
float left = m_layout.left;
float top = m_layout.top - icon_stride;
bool found = false;
for (const GLToolbarItem* item : m_items) {
if (!item->is_visible())
continue;
@ -1164,11 +1169,15 @@ void GLToolbar::render_arrow(const GLCanvas3D& parent, GLToolbarItem* highlighte
if (item->is_separator())
left += separator_stride;
else {
if (item->get_name() == highlighted_item->get_name())
if (item->get_name() == highlighted_item->get_name()) {
found = true;
break;
}
left += icon_stride;
}
}
if (!found)
return;
left += border;
top -= separator_stride;