Rectangle selection -> Min size of rectangle selection set to 1 pixel

This commit is contained in:
Enrico Turri 2019-04-29 08:31:32 +02:00
parent fdf1b8af81
commit dfe2719656

View File

@ -3751,12 +3751,10 @@ void GLCanvas3D::_rectangular_selection_picking_pass() const
if (m_multisample_allowed)
glsafe(::glEnable(GL_MULTISAMPLE));
int width = (int)m_rectangle_selection.get_width();
int height = (int)m_rectangle_selection.get_height();
int width = std::max((int)m_rectangle_selection.get_width(), 1);
int height = std::max((int)m_rectangle_selection.get_height(), 1);
int px_count = width * height;
if (px_count > 0)
{
int left = (int)m_rectangle_selection.get_left();
int top = get_canvas_size().get_height() - (int)m_rectangle_selection.get_top();
if ((left >= 0) && (top >= 0))
@ -3801,7 +3799,6 @@ void GLCanvas3D::_rectangular_selection_picking_pass() const
#endif // USE_PARALLEL
}
}
}
m_hover_volume_idxs.assign(idxs.begin(), idxs.end());
_update_volumes_hover_state();