11#include <glib/gi18n.h>
30 pm._multi_path_manipulator._path_data.dragpoint_group),
53 if (
first->front()->isDegenerate() && second->back()->isDegenerate()) {
61 second->back()->move(second->back()->position() -
delta);
77 first->front()->retract();
78 second->back()->retract();
97 if (t <= 1.0 / 6.0)
weight = 0;
98 else if (t <= 0.5)
weight = (pow((6 * t - 1) / 2.0, 3)) / 2;
99 else if (t <= 5.0 / 6.0)
weight = (1 - pow((6 * (1-t) - 1) / 2.0, 3)) / 2 + 0.5;
108 first->front()->move(
first->front()->position() + offset0);
109 second->back()->move(second->back()->position() + offset1);
110 }
else if (
weight >= 0.8) {
112 second->back()->move(new_pos);
114 second->move(second->position() +
delta);
116 }
else if (
weight <= 0.2) {
118 first->back()->move(new_pos);
124 second->move(second->position() +
delta);
142 if (!second)
return false;
153 if (
first->selected() && second->selected()) {
203 return C_(
"Path segment tip",
204 "<b>Shift</b>: drag to open or move BSpline handles");
207 return C_(
"Path segment tip",
208 "<b>Shift</b>: click to toggle segment selection");
211 return C_(
"Path segment tip",
212 "<b>Ctrl+Alt</b>: click to insert a node");
215 return C_(
"Path segment tip",
"<b>Alt</b>: double click to change line type");
218 return C_(
"Path segment tip",
"<b>BSpline segment</b>: drag to shape the segment, doubleclick to insert node, "
219 "click to select (more: Alt, Shift, Ctrl+Alt)");
222 return C_(
"Path segment tip",
"<b>Linear segment</b>: drag to convert to a Bezier segment, "
223 "doubleclick to insert node, click to select (more: Alt, Shift, Ctrl+Alt)");
225 return C_(
"Path segment tip",
"<b>Bezier segment</b>: drag to shape the segment, doubleclick to insert node, "
226 "click to select (more: Alt, Shift, Ctrl+Alt)");
pair< double, double > Point
Axis-aligned rectangle that can be empty.
Two-dimensional point that doubles as a vector.
Class to store data for points which are snap candidates, either as a source or as a target.
Class describing the result of an attempt to snap.
Geom::Point getPoint() const
std::pair< iterator, bool > insert(const value_type &x, bool notify=true, bool to_update=true)
Add a control point to the selection.
void erase(iterator pos, bool to_update=true)
Remove a point from the selection.
void restoreTransformHandles()
void clear()
Remove all points from the selection, making it empty.
void hideTransformHandles()
Draggable point, the workhorse of on-canvas editing.
Geom::Point const & position() const
Current position of the control point.
static bool _is_drag_cancelled(MotionEvent const &event)
virtual void setVisible(bool v)
Set the visibility of the control point.
SPDesktop *const _desktop
The desktop this control point resides on.
static Glib::ustring virtual bool _eventHandler(Inkscape::UI::Tools::ToolBase *event_context, CanvasEvent const &event)
static bool _drag_initiated
CanvasItemPtr< Inkscape::CanvasItemCtrl > _canvas_item_ctrl
Visual representation of the control point.
CurveDragPoint(PathManipulator &pm)
static bool _drags_stroke
void _insertNode(bool take_selection)
bool grabbed(MotionEvent const &) override
Called when the user moves the point beyond the drag tolerance with the first button held down.
bool clicked(ButtonReleaseEvent const &) override
Called when the control point is clicked, at mouse button release.
void ungrabbed(ButtonReleaseEvent const *) override
Called when the control point finishes a drag.
bool doubleclicked(ButtonReleaseEvent const &) override
Called when the control point is doubleclicked, at mouse button release.
void dragged(Geom::Point &, MotionEvent const &) override
Called while dragging, but before moving the knot to new position.
static bool _segment_was_degenerate
bool _eventHandler(Inkscape::UI::Tools::ToolBase *event_context, CanvasEvent const &event) override
Glib::ustring _getTip(unsigned state) const override
Manipulator that edits a single path using nodes with handles.
void update(bool alert_LPE=false)
Update the display and the outline of the path.
void setSegmentType(SegmentType)
Make selected segments curves / lines.
Geom::Coord _updateDragPoint(Geom::Point const &)
Update the position of the curve drag point such that it is over the nearest point of the path.
void _commit(Glib::ustring const &annotation)
Update the XML representation and put the specified annotation on the undo stack.
bool empty()
Check whether the manipulator has any nodes.
void insertNode(Geom::Point)
SPObject * _path
can be an SPPath or an Inkscape::LivePathEffect::Effect !!!
ControlPointSelection & _selection
Geom::Affine const & d2w() const
Transformation from desktop to window coordinates.
SPNamedView * getNamedView() const
Base class for visual SVG elements.
Control point selection - stores a set of control points and applies transformations to them.
Editable view implementation.
Multi path manipulator - a tool component that edits multiple paths at once.
Various utility functions.
@ SEGMENT_STRAIGHT
Straight linear segment.
Helper class to stream background task notifications as a series of messages.
bool mod_alt(unsigned modifiers)
@ SNAPSOURCE_OTHER_HANDLE
bool mod_ctrl(unsigned modifiers)
@ CANVAS_ITEM_CTRL_TYPE_INVISIPOINT
bool mod_shift(unsigned modifiers)
Path manipulator - a component that edits a single path on-canvas.
Linear linear(double ax, double b)
Abstract base class for events.
unsigned modifiers
The modifiers mask immediately before the event.
Movement of the mouse pointer.