improve multiselection UX
This commit is contained in:
@@ -2237,7 +2237,7 @@ selection_result MapView::intersect_result(bool terrain_only)
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapView::doSelection (bool selectTerrainOnly)
|
void MapView::doSelection (bool selectTerrainOnly, bool mouseMove)
|
||||||
{
|
{
|
||||||
selection_result results(intersect_result(selectTerrainOnly));
|
selection_result results(intersect_result(selectTerrainOnly));
|
||||||
|
|
||||||
@@ -2257,7 +2257,7 @@ void MapView::doSelection (bool selectTerrainOnly)
|
|||||||
{
|
{
|
||||||
_world->add_to_selection(hit);
|
_world->add_to_selection(hit);
|
||||||
}
|
}
|
||||||
else
|
else if (!mouseMove)
|
||||||
{
|
{
|
||||||
_world->remove_from_selection(hit);
|
_world->remove_from_selection(hit);
|
||||||
}
|
}
|
||||||
@@ -2275,7 +2275,7 @@ void MapView::doSelection (bool selectTerrainOnly)
|
|||||||
_world->range_add_to_selection(_cursor_pos, objectEditor->brushRadius(), true);
|
_world->range_add_to_selection(_cursor_pos, objectEditor->brushRadius(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (!_mod_space_down && !_mod_alt_down)
|
||||||
{
|
{
|
||||||
_world->reset_selection();
|
_world->reset_selection();
|
||||||
_world->add_to_selection(hit);
|
_world->add_to_selection(hit);
|
||||||
@@ -2774,7 +2774,7 @@ void MapView::mouseMoveEvent (QMouseEvent* event)
|
|||||||
{
|
{
|
||||||
if (terrainMode == editing_mode::object)
|
if (terrainMode == editing_mode::object)
|
||||||
{
|
{
|
||||||
doSelection(false); // Required for radius selection in Object mode
|
doSelection(false, true); // Required for radius selection in Object mode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2854,7 +2854,10 @@ void MapView::mousePressEvent(QMouseEvent* event)
|
|||||||
|
|
||||||
if (leftMouse)
|
if (leftMouse)
|
||||||
{
|
{
|
||||||
doSelection(false);
|
if (!(terrainMode == editing_mode::mccv && _mod_ctrl_down))
|
||||||
|
{
|
||||||
|
doSelection(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (rightMouse)
|
else if (rightMouse)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ private:
|
|||||||
|
|
||||||
math::ray intersect_ray() const;
|
math::ray intersect_ray() const;
|
||||||
selection_result intersect_result(bool terrain_only);
|
selection_result intersect_result(bool terrain_only);
|
||||||
void doSelection(bool selectTerrainOnly);
|
void doSelection(bool selectTerrainOnly, bool mouseMove = false);
|
||||||
void update_cursor_pos();
|
void update_cursor_pos();
|
||||||
|
|
||||||
display_mode _display_mode;
|
display_mode _display_mode;
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ namespace noggit
|
|||||||
QSize sizeHint() const override;
|
QSize sizeHint() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float _radius = 15.0f;
|
float _radius = 0.01f;
|
||||||
|
|
||||||
QSlider* _radius_slider;
|
QSlider* _radius_slider;
|
||||||
QDoubleSpinBox* _radius_spin;
|
QDoubleSpinBox* _radius_spin;
|
||||||
|
|||||||
Reference in New Issue
Block a user