From 61cbbcbe02f11d67e4fe9f3c4f452442d2e9f778 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Fri, 3 Nov 2017 01:55:01 +0100 Subject: Start migrating 0.92 patch to master --- src/ui/tool/control-point-selection.h | 5 +++-- src/ui/tool/selectable-control-point.cpp | 9 +++++++++ src/ui/tool/selectable-control-point.h | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src/ui') diff --git a/src/ui/tool/control-point-selection.h b/src/ui/tool/control-point-selection.h index ec845b1b3..d0cfce8d2 100644 --- a/src/ui/tool/control-point-selection.h +++ b/src/ui/tool/control-point-selection.h @@ -117,6 +117,8 @@ public: void getOriginalPoints(std::vector &pts); void getUnselectedPoints(std::vector &pts); void setOriginalPoints(); + //the purpose of this list is to keep track of first and last selected + std::list _points_list; private: // The functions below are invoked from SelectableControlPoint. @@ -140,8 +142,7 @@ private: double _rotationRadius(Geom::Point const &); set_type _points; - //the purpose of this list is to keep track of first and last selected - std::list _points_list; + set_type _all_points; INK_UNORDERED_MAP _original_positions; INK_UNORDERED_MAP _last_trans; diff --git a/src/ui/tool/selectable-control-point.cpp b/src/ui/tool/selectable-control-point.cpp index f3f9c0e1e..83ed7d38b 100644 --- a/src/ui/tool/selectable-control-point.cpp +++ b/src/ui/tool/selectable-control-point.cpp @@ -87,6 +87,15 @@ bool SelectableControlPoint::clicked(GdkEventButton *event) return true; } +void SelectableControlPoint::select(bool toselect) +{ + if (toselect) { + _selection.insert(this); + } else { + _selection.erase(this); + } +} + void SelectableControlPoint::_takeSelection() { _selection.clear(); diff --git a/src/ui/tool/selectable-control-point.h b/src/ui/tool/selectable-control-point.h index 362d4addc..c16f639b1 100644 --- a/src/ui/tool/selectable-control-point.h +++ b/src/ui/tool/selectable-control-point.h @@ -28,8 +28,10 @@ public: virtual Geom::Rect bounds() const { return Geom::Rect(position(), position()); } + virtual void select(bool toselect); friend class NodeList; + protected: SelectableControlPoint(SPDesktop *d, Geom::Point const &initial_pos, SPAnchorType anchor, -- cgit v1.2.3