diff --git a/src/GUI/Plater/Plate2D.cpp b/src/GUI/Plater/Plate2D.cpp index 8dd729c52..b25c256eb 100644 --- a/src/GUI/Plater/Plate2D.cpp +++ b/src/GUI/Plater/Plate2D.cpp @@ -154,14 +154,16 @@ void Plate2D::mouse_drag(wxMouseEvent& e) { ); model_object->update_bounding_box(); this->Refresh(); - } else { - auto cursor = wxSTANDARD_CURSOR; - /* - if (find_first_of(this->objects.begin(), this->objects.end(); [=](const PlaterObject& o) { return o.contour->contains_point(point);} ) == this->object.end()) { - cursor = wxCursor(wxCURSOR_HAND); + } else { // moving + + if (std::any_of(this->objects.cbegin(), this->objects.cend(), + [=](const Slic3r::GUI::PlaterObject o) { return o.instance_contains(point); }) + ) + { + this->SetCursor(wxCURSOR_HAND); + } else { + this->SetCursor(*wxSTANDARD_CURSOR); } - */ - this->SetCursor(*cursor); } } diff --git a/src/GUI/Plater/PlaterObject.cpp b/src/GUI/Plater/PlaterObject.cpp index 442c5d412..1ecee7b49 100644 --- a/src/GUI/Plater/PlaterObject.cpp +++ b/src/GUI/Plater/PlaterObject.cpp @@ -55,4 +55,11 @@ Slic3r::ExPolygonCollection& PlaterObject::transform_thumbnail(std::shared_ptrtransformed_thumbnail; } +bool PlaterObject::instance_contains(Slic3r::Point point) const { + return std::any_of(this->instance_thumbnails.cbegin(), this->instance_thumbnails.cend(), + [point](const ExPolygonCollection ep) { + return ep.contains(point); + }); +} + } } // Namespace Slic3r::GUI diff --git a/src/GUI/Plater/PlaterObject.hpp b/src/GUI/Plater/PlaterObject.hpp index d1d2f7056..d5f857583 100644 --- a/src/GUI/Plater/PlaterObject.hpp +++ b/src/GUI/Plater/PlaterObject.hpp @@ -33,6 +33,8 @@ public: Slic3r::ExPolygonCollection& transform_thumbnail(const Slic3r::Model model, int obj_idx); Slic3r::ExPolygonCollection& transform_thumbnail(const std::shared_ptr model, int obj_idx); + bool instance_contains(Slic3r::Point point) const; + protected: const std::string LogChannel {"PlaterObject"};