21#include <gdk/gdkkeysyms.h>
22#include <glibmm/i18n.h>
68 if (prefs->
getBool(
"/tools/shapes/selcue")) {
72 if (prefs->
getBool(
"/tools/shapes/gradientdrag")) {
107 if (
name ==
"expansion") {
109 }
else if (
name ==
"revolution") {
111 }
else if (
name ==
"t0") {
121 tolerance = prefs->getIntLimited(
"/options/dragtolerance/value", 0, 0, 100);
127 if (event.num_press == 1 && event.button == 1) {
130 setup_for_drag_start(event);
131 center = _desktop->w2d(event.pos);
134 auto &m = _desktop->getNamedView()->snap_manager;
136 m.freeSnapReturnByRef(center, SNAPSOURCE_NODE_HANDLE);
172 if (
dragging && event.button == 1) {
200 case GDK_KEY_Control_L:
201 case GDK_KEY_Control_R:
202 case GDK_KEY_Shift_L:
203 case GDK_KEY_Shift_R:
207 _(
"<b>Ctrl</b>: snap angle"),
209 _(
"<b>Alt</b>: lock spiral radius"));
245 case GDK_KEY_KP_Delete:
246 case GDK_KEY_BackSpace:
258 case GDK_KEY_Control_L:
259 case GDK_KEY_Control_R:
260 case GDK_KEY_Shift_L:
261 case GDK_KEY_Shift_R:
279 int const snaps = prefs->
getInt(
"/options/rotationsnapsperpi/value", 12);
314 if (state & GDK_CONTROL_MASK) {
316 double snaps_radian = M_PI/snaps;
317 arg = std::round(arg/snaps_radian) * snaps_radian;
331 _(
"<b>Spiral</b>: radius %s, angle %.2f°; with <b>Ctrl</b> to snap angle"),
332 rads.c_str(), arg * 180/M_PI + 360*
spiral->
revo);
Coord descrim() const
Calculate the descriminant.
Affine inverse() const
Compute the inverse matrix.
Two-dimensional point that doubles as a vector.
static void done(SPDocument *document, Glib::ustring const &event_description, Glib::ustring const &undo_icon, unsigned int object_modified_tag=0)
static void cancel(SPDocument *document)
void clear()
removes our current message from the stack
void clear()
Unselects all selected objects.
SPItem * singleItem()
Returns a single selected item.
Data type representing a typeless value of a preference.
double getDouble(double def=0.0, Glib::ustring const &unit="") const
Interpret the preference as a floating point value.
Glib::ustring getEntryName() const
Get the last component of the preference's path.
Preference storage class.
bool getBool(Glib::ustring const &pref_path, bool def=false)
Retrieve a Boolean value.
static Preferences * get()
Access the singleton Preferences object.
int getInt(Glib::ustring const &pref_path, int def=0)
Retrieve an integer.
The set of selected SPObjects for a given document and layer model.
void set(XML::Node *repr)
Set the selection to an XML node's SPObject.
sigc::connection connectChanged(sigc::slot< void(Selection *)> slot)
Connects a slot to be notified of selection changes.
Class to store data for points which are snap candidates, either as a source or as a target.
void set_item(SPItem *item)
void unset_item(bool keep_knotholder=false)
Glib::ustring string(Unit const *u) const
Return a printable string of the value in the specified unit.
Interface for refcounted XML nodes.
void setAttribute(Util::const_char_ptr key, Util::const_char_ptr value)
Change an attribute of this node.
To do: update description of desktop.
SPDocument * getDocument() const
void setToolboxFocusTo(char const *label)
Geom::Affine const & dt2doc() const
SPNamedView * getNamedView() const
Inkscape::Selection * getSelection() const
Geom::Affine const & w2d() const
Transformation from window to desktop coordinates (zoom/rotate).
Inkscape::XML::Document * getReprDoc()
Our Inkscape::XML::Document.
Base class for visual SVG elements.
void adjust_stroke_width_recursive(double ex)
Recursively scale stroke width in item and its children by expansion.
Geom::Affine i2doc_affine() const
Returns the accumulated transformation of the item and all its ancestors, including root's viewport.
void doWriteTransform(Geom::Affine const &transform, Geom::Affine const *adv=nullptr, bool compensate=true)
Set a new transform on an object.
void setCenter(Geom::Point const &object_centre)
Sets the transform_center_x and transform_center_y properties to retain the rotation center.
Inkscape::Util::Unit const * display_units
Inkscape::XML::Node * updateRepr(unsigned int flags=SP_OBJECT_WRITE_EXT)
Updates the object's repr based on the object's state.
void deleteObject(bool propagate, bool propagate_descendants)
Deletes an object, unparenting it from its parent.
void set_shape() override
float revo
Spiral revolution factor.
void setPosition(double cx, double cy, double exp, double revo, double rad, double arg, double t0)
Set spiral properties and update display.
Class to coordinate snapping operations.
void setup(SPDesktop const *desktop, bool snapindicator=true, SPObject const *item_to_ignore=nullptr, std::vector< Inkscape::SnapCandidatePoint > *unselected_nodes=nullptr)
Convenience shortcut when there is only one item to ignore.
void freeSnapReturnByRef(Geom::Point &p, Inkscape::SnapSourceType const source_type, Geom::OptRect const &bbox_to_snap=Geom::OptRect()) const
Try to snap a point to grids, guides or objects.
void sp_desktop_apply_style_tool(SPDesktop *desktop, Inkscape::XML::Node *repr, Glib::ustring const &tool_path, bool with_text)
Apply the desktop's current style or the tool style to repr.
Editable view implementation.
TODO: insert short description here.
Macro for icon names used in Inkscape.
Interface for locally managing a current status message.
double atan2(Point const &p)
SBasis L2(D2< SBasis > const &a, unsigned k)
static R & release(R &r)
Decrements the reference count of a anchored object.
void inspect_event(E &&event, Fs... funcs)
Perform pattern-matching on a CanvasEvent.
bool mod_ctrl_only(unsigned modifiers)
bool mod_alt_only(unsigned modifiers)
bool have_viable_layer(SPDesktop *desktop, MessageContext *message)
Check to see if the current layer is both unhidden and unlocked.
Inkscape::ShapeEditor This is a container class which contains a knotholder for shapes.
void sp_lpe_item_update_patheffect(SPLPEItem *lpeitem, bool wholetree, bool write, bool with_satellites)
Calls any registered handlers for the update_patheffect action.
Abstract base class for events.
unsigned modifiers
The modifiers mask immediately before the event.
Movement of the mouse pointer.
Interface for XML documents.
virtual Node * createElement(char const *name)=0