Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_selection_undoredo

This commit is contained in:
Enrico Turri 2019-07-23 15:14:19 +02:00
commit 9a127ed016
9 changed files with 34 additions and 20 deletions

View file

@ -166,7 +166,7 @@ void GLGizmoBase::set_highlight_color(const float* color)
void GLGizmoBase::enable_grabber(unsigned int id)
{
if ((0 <= id) && (id < (unsigned int)m_grabbers.size()))
if (id < m_grabbers.size())
m_grabbers[id].enabled = true;
on_enable_grabber(id);
@ -174,7 +174,7 @@ void GLGizmoBase::enable_grabber(unsigned int id)
void GLGizmoBase::disable_grabber(unsigned int id)
{
if ((0 <= id) && (id < (unsigned int)m_grabbers.size()))
if (id < m_grabbers.size())
m_grabbers[id].enabled = false;
on_disable_grabber(id);

View file

@ -93,19 +93,19 @@ protected:
}
virtual void on_set_hover_id()
{
for (unsigned int i = 0; i < 3; ++i)
for (int i = 0; i < 3; ++i)
{
m_gizmos[i].set_hover_id((m_hover_id == i) ? 0 : -1);
}
}
virtual void on_enable_grabber(unsigned int id)
{
if ((0 <= id) && (id < 3))
if (id < 3)
m_gizmos[id].enable_grabber(0);
}
virtual void on_disable_grabber(unsigned int id)
{
if ((0 <= id) && (id < 3))
if (id < 3)
m_gizmos[id].disable_grabber(0);
}
virtual void on_start_dragging();

View file

@ -223,7 +223,7 @@ void GLGizmosManager::update_data()
enable_grabber(Rotate, 1, !is_wipe_tower);
bool enable_scale_xyz = selection.is_single_full_instance() || selection.is_single_volume() || selection.is_single_modifier();
for (int i = 0; i < 6; ++i)
for (unsigned int i = 0; i < 6; ++i)
{
enable_grabber(Scale, i, enable_scale_xyz);
}

View file

@ -323,9 +323,9 @@ public:
}
bool SwapChildrens(int frst_id, int scnd_id) {
if (GetChildCount() < 2 ||
frst_id < 0 || frst_id >= GetChildCount() ||
scnd_id < 0 || scnd_id >= GetChildCount())
if (GetChildCount() < 2 ||
frst_id < 0 || (size_t)frst_id >= GetChildCount() ||
scnd_id < 0 || (size_t)scnd_id >= GetChildCount())
return false;
ObjectDataViewModelNode new_scnd = *GetNthChild(frst_id);