126
* Try to snap a point to any of the specified snappers.
128
* \param point_type Type of point.
130
* \param first_point If true then this point is the first one from a whole bunch of points
131
* \param points_to_snap The whole bunch of points, all from the same selection and having the same transformation
132
* \param snappers List of snappers to try to snap to
133
* \return Snapped point.
148
* \brief Try to snap a point to grids, guides or objects.
150
* Try to snap a point to grids, guides or objects, in two degrees-of-freedom,
151
* i.e. snap in any direction on the two dimensional canvas to the nearest
152
* snap target. freeSnapReturnByRef() is equal in snapping behavior to
153
* freeSnap(), but the former returns the snapped point trough the referenced
154
* parameter p. This parameter p initially contains the position of the snap
155
* source and will we overwritten by the target position if snapping has occurred.
156
* This makes snapping transparent to the calling code. If this is not desired
157
* because either the calling code must know whether snapping has occurred, or
158
* because the original position should not be touched, then freeSnap() should be
161
* PS: SnapManager::setup() must have been called before calling this method,
162
* but only once for a set of points
164
* \param point_type Category of points to which the source point belongs: node, guide or bounding box
165
* \param p Current position of the snap source; will be overwritten by the position of the snap target if snapping has occurred
166
* \param source_type Detailed description of the source type, will be used by the snap indicator
167
* \param first_point If true then this point is the first one from a set of points, all from the same selection and having the same transformation
168
* \param bbox_to_snap Bounding box hulling the set of points, all from the same selection and having the same transformation
136
171
void SnapManager::freeSnapReturnByRef(Inkscape::SnapPreferences::PointType point_type,
139
174
bool first_point,
140
175
Geom::OptRect const &bbox_to_snap) const
177
//TODO: PointType and source_type are somewhat redundant; can't we get rid of the point_type parameter?
142
178
Inkscape::SnappedPoint const s = freeSnap(point_type, p, source_type, first_point, bbox_to_snap);
148
* Try to snap a point to any of the specified snappers.
150
* \param point_type Type of point.
152
* \param first_point If true then this point is the first one from a whole bunch of points
153
* \param points_to_snap The whole bunch of points, all from the same selection and having the same transformation
154
* \param snappers List of snappers to try to snap to
155
* \return Snapped point.
184
* \brief Try to snap a point to grids, guides or objects.
186
* Try to snap a point to grids, guides or objects, in two degrees-of-freedom,
187
* i.e. snap in any direction on the two dimensional canvas to the nearest
188
* snap target. freeSnap() is equal in snapping behavior to
189
* freeSnapReturnByRef(). Please read the comments of the latter for more details
191
* PS: SnapManager::setup() must have been called before calling this method,
192
* but only once for a set of points
194
* \param point_type Category of points to which the source point belongs: node, guide or bounding box
195
* \param p Current position of the snap source
196
* \param source_type Detailed description of the source type, will be used by the snap indicator
197
* \param first_point If true then this point is the first one from a set of points, all from the same selection and having the same transformation
198
* \param bbox_to_snap Bounding box hulling the set of points, all from the same selection and having the same transformation
199
* \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics
158
203
Inkscape::SnappedPoint SnapManager::freeSnap(Inkscape::SnapPreferences::PointType point_type,
159
204
Geom::Point const &p,
160
205
Inkscape::SnapSourceType const &source_type,
196
241
return findBestSnap(p, source_type, sc, false);
199
// When pasting, we would like to snap to the grid. Problem is that we don't know which nodes were
200
// aligned to the grid at the time of copying, so we don't know which nodes to snap. If we'd snap an
201
// unaligned node to the grid, previously aligned nodes would become unaligned. That's undesirable.
202
// Instead we will make sure that the offset between the source and the copy is a multiple of the grid
203
// pitch. If the source was aligned, then the copy will therefore also be aligned
204
// PS: Whether we really find a multiple also depends on the snapping range!
245
* \brief Snap to the closest multiple of a grid pitch
247
* When pasting, we would like to snap to the grid. Problem is that we don't know which
248
* nodes were aligned to the grid at the time of copying, so we don't know which nodes
249
* to snap. If we'd snap an unaligned node to the grid, previously aligned nodes would
250
* become unaligned. That's undesirable. Instead we will make sure that the offset
251
* between the source and its pasted copy is a multiple of the grid pitch. If the source
252
* was aligned, then the copy will therefore also be aligned.
254
* PS: Whether we really find a multiple also depends on the snapping range! Most users
255
* will have "always snap" enabled though, in which case a multiple will always be found.
256
* PS2: When multiple grids are present then the result will become ambiguous. There is no
257
* way to control to which grid this method will snap.
259
* \param t Vector that represents the offset of the pasted copy with respect to the original
260
* \return Offset vector after snapping to the closest multiple of a grid pitch
205
263
Geom::Point SnapManager::multipleOfGridPitch(Geom::Point const &t) const
207
265
if (!snapprefs.getSnapEnabledGlobally()) // No need to check for snapprefs.getSnapPostponedGlobally() here
210
//FIXME: this code should actually do this: add new grid snappers that are active for this desktop. now it just adds all gridsnappers
212
268
if (_desktop && _desktop->gridsEnabled()) {
213
269
bool success = false;
214
270
Geom::Point nearest_multiple;
255
* Try to snap a point to any interested snappers. A snap will only occur along
256
* a line described by a Inkscape::Snapper::ConstraintLine.
258
* \param point_type Type of point.
260
* \param first_point If true then this point is the first one from a whole bunch of points
261
* \param points_to_snap The whole bunch of points, all from the same selection and having the same transformation
262
* \param constraint Constraint line.
263
* \return Snapped point.
311
* \brief Try to snap a point along a constraint line to grids, guides or objects.
313
* Try to snap a point to grids, guides or objects, in only one degree-of-freedom,
314
* i.e. snap in a specific direction on the two dimensional canvas to the nearest
317
* constrainedSnapReturnByRef() is equal in snapping behavior to
318
* constrainedSnap(), but the former returns the snapped point trough the referenced
319
* parameter p. This parameter p initially contains the position of the snap
320
* source and will we overwritten by the target position if snapping has occurred.
321
* This makes snapping transparent to the calling code. If this is not desired
322
* because either the calling code must know whether snapping has occurred, or
323
* because the original position should not be touched, then constrainedSnap() should
326
* PS: SnapManager::setup() must have been called before calling this method,
327
* but only once for a set of points
329
* \param point_type Category of points to which the source point belongs: node, guide or bounding box
330
* \param p Current position of the snap source; will be overwritten by the position of the snap target if snapping has occurred
331
* \param source_type Detailed description of the source type, will be used by the snap indicator
332
* \param constraint The direction or line along which snapping must occur
333
* \param first_point If true then this point is the first one from a set of points, all from the same selection and having the same transformation
334
* \param bbox_to_snap Bounding box hulling the set of points, all from the same selection and having the same transformation
266
337
void SnapManager::constrainedSnapReturnByRef(Inkscape::SnapPreferences::PointType point_type,
268
339
Inkscape::SnapSourceType const source_type,
269
340
Inkscape::Snapper::ConstraintLine const &constraint,
270
bool const snap_projection,
271
341
bool first_point,
272
342
Geom::OptRect const &bbox_to_snap) const
274
Inkscape::SnappedPoint const s = constrainedSnap(point_type, p, source_type, constraint, snap_projection, first_point, bbox_to_snap);
344
Inkscape::SnappedPoint const s = constrainedSnap(point_type, p, source_type, constraint, first_point, bbox_to_snap);
280
* Try to snap a point to any interested snappers. A snap will only occur along
281
* a line described by a Inkscape::Snapper::ConstraintLine.
283
* \param point_type Type of point.
285
* \param first_point If true then this point is the first one from a whole bunch of points
286
* \param points_to_snap The whole bunch of points, all from the same selection and having the same transformation
287
* \param constraint Constraint line.
288
* \return Snapped point.
349
* \brief Try to snap a point along a constraint line to grids, guides or objects.
351
* Try to snap a point to grids, guides or objects, in only one degree-of-freedom,
352
* i.e. snap in a specific direction on the two dimensional canvas to the nearest
353
* snap target. constrainedSnap is equal in snapping behavior to
354
* constrainedSnapReturnByRef(). Please read the comments of the latter for more details.
356
* PS: SnapManager::setup() must have been called before calling this method,
357
* but only once for a set of points
359
* \param point_type Category of points to which the source point belongs: node, guide or bounding box
360
* \param p Current position of the snap source
361
* \param source_type Detailed description of the source type, will be used by the snap indicator
362
* \param constraint The direction or line along which snapping must occur
363
* \param first_point If true then this point is the first one from a set of points, all from the same selection and having the same transformation
364
* \param bbox_to_snap Bounding box hulling the set of points, all from the same selection and having the same transformation
291
367
Inkscape::SnappedPoint SnapManager::constrainedSnap(Inkscape::SnapPreferences::PointType point_type,
292
368
Geom::Point const &p,
293
369
Inkscape::SnapSourceType const &source_type,
294
370
Inkscape::Snapper::ConstraintLine const &constraint,
295
bool /*snap_projection*/,
296
371
bool first_point,
297
372
Geom::OptRect const &bbox_to_snap) const
299
if (_desktop->event_context && _desktop->event_context->_snap_window_open == false) {
374
if (_desktop->event_context && _desktop->event_context->_snap_window_open == false) {
300
375
g_warning("The current tool tries to snap, but it hasn't yet opened the snap window. Please report this!");
301
376
// When the context goes into dragging-mode, then Inkscape should call this: sp_event_context_snap_window_open(event_context);
330
405
return findBestSnap(p, source_type, sc, true);
333
// guideFreeSnap is used when dragging or rotating the guide
409
* \brief Try to snap a point of a guide to another guide or to a node
411
* Try to snap a point of a guide to another guide or to a node in two degrees-
412
* of-freedom, i.e. snap in any direction on the two dimensional canvas to the
413
* nearest snap target. This method is used when dragging or rotating a guide
415
* PS: SnapManager::setup() must have been called before calling this method,
417
* \param p Current position of the point on the guide that is to be snapped; will be overwritten by the position of the snap target if snapping has occurred
418
* \param guide_normal Vector normal to the guide line
334
420
void SnapManager::guideFreeSnap(Geom::Point &p, Geom::Point const &guide_normal) const
336
// This method is used to snap a guide to nodes or to other guides, while dragging the guide around. Will not snap to grids!
338
if (_desktop->event_context && _desktop->event_context->_snap_window_open == false) {
422
if (_desktop->event_context && _desktop->event_context->_snap_window_open == false) {
339
423
g_warning("The current tool tries to snap, but it hasn't yet opened the snap window. Please report this!");
340
424
// When the context goes into dragging-mode, then Inkscape should call this: sp_event_context_snap_window_open(event_context);
368
// guideConstrainedSnap is used when dragging the origin of the guide along the guide itself
453
* \brief Try to snap a point on a guide to the intersection with another guide or a path
455
* Try to snap a point on a guide to the intersection of that guide with another
456
* guide or with a path. The snapped point will lie somewhere on the guide-line,
457
* making this is a constrained snap, i.e. in only one degree-of-freedom.
458
* This method is used when dragging the origin of the guide along the guide itself.
460
* PS: SnapManager::setup() must have been called before calling this method,
462
* \param p Current position of the point on the guide that is to be snapped; will be overwritten by the position of the snap target if snapping has occurred
463
* \param guide_normal Vector normal to the guide line
369
466
void SnapManager::guideConstrainedSnap(Geom::Point &p, SPGuide const &guideline) const
371
// This method is used to snap a guide to paths or to other guides, while dragging the origin of the guide around. Will not snap to grids!
373
468
if (_desktop->event_context && _desktop->event_context->_snap_window_open == false) {
374
469
g_warning("The current tool tries to snap, but it hasn't yet opened the snap window. Please report this!");
375
470
// When the context goes into dragging-mode, then Inkscape should call this: sp_event_context_snap_window_open(event_context);
405
* Main internal snapping method, which is called by the other, friendlier, public
406
* methods. It's a bit hairy as it has lots of parameters, but it saves on a lot
407
* of duplicated code.
409
* \param type Type of points being snapped.
410
* \param points List of points to snap (i.e. untransformed).
411
* \param pointer Location of the mouse pointer, at the time when dragging started (i.e. "untransformed")
412
* \param constrained true if the snap is constrained.
413
* \param constraint Constraint line to use, if `constrained' is true, otherwise undefined.
500
* \brief Method for snapping sets of points while they are being transformed
502
* Method for snapping sets of points while they are being transformed, when using
503
* for example the selector tool. This method is for internal use only, and should
504
* not have to be called directly. Use freeSnapTransalation(), constrainedSnapScale(),
507
* This is what is being done in this method: transform each point, find out whether
508
* a free snap or constrained snap is more appropriate, do the snapping, calculate
509
* some metrics to quantify the snap "distance", and see if it's better than the
510
* previous snap. Finally, the best ("nearest") snap from all these points is returned.
512
* \param type Category of points to which the source point belongs: node or bounding box.
513
* \param points Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
514
* \param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
515
* \param constrained true if the snap is constrained, e.g. for stretching or for purely horizontal translation.
516
* \param constraint The direction or line along which snapping must occur, if 'constrained' is true; otherwise undefined.
414
517
* \param transformation_type Type of transformation to apply to points before trying to snap them.
415
518
* \param transformation Description of the transformation; details depend on the type.
416
519
* \param origin Origin of the transformation, if applicable.
417
* \param dim Dimension of the transformation, if applicable.
520
* \param dim Dimension to which the transformation applies, if applicable.
418
521
* \param uniform true if the transformation should be uniform; only applicable for stretching and scaling.
522
* \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
421
525
Inkscape::SnappedPoint SnapManager::_snapTransformed(
508
612
// move in that specific direction; therefore it should only snap in that direction, otherwise
509
613
// we will get snapped points with an invalid transformation
510
614
dedicated_constraint = Inkscape::Snapper::ConstraintLine(origin, component_vectors[c1]);
511
snapped_point = constrainedSnap(type, (*j).first, static_cast<Inkscape::SnapSourceType>((*j).second), dedicated_constraint, false, i == points.begin(), bbox);
615
snapped_point = constrainedSnap(type, (*j).first, static_cast<Inkscape::SnapSourceType>((*j).second), dedicated_constraint, i == points.begin(), bbox);
513
617
snapped_point = freeSnap(type, (*j).first, static_cast<Inkscape::SnapSourceType>((*j).second), i == points.begin(), bbox);
652
* Try to snap a list of points to any interested snappers after they have undergone
756
* \brief Apply a translation to a set of points and try to snap freely in 2 degrees-of-freedom
655
* \param point_type Type of points.
657
* \param tr Proposed translation.
658
* \return Snapped translation, if a snap occurred, and a flag indicating whether a snap occurred.
758
* \param point_type Category of points to which the source point belongs: node or bounding box.
759
* \param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
760
* \param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
761
* \param tr Proposed translation; the final translation can only be calculated after snapping has occurred
762
* \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
661
765
Inkscape::SnappedPoint SnapManager::freeSnapTranslation(Inkscape::SnapPreferences::PointType point_type,
670
774
return _snapTransformed(point_type, p, pointer, false, Geom::Point(0,0), TRANSLATION, tr, Geom::Point(0,0), Geom::X, false);
675
* Try to snap a list of points to any interested snappers after they have undergone a
676
* translation. A snap will only occur along a line described by a
677
* Inkscape::Snapper::ConstraintLine.
778
* \brief Apply a translation to a set of points and try to snap along a constraint
679
* \param point_type Type of points.
681
* \param constraint Constraint line.
682
* \param tr Proposed translation.
683
* \return Snapped translation, if a snap occurred, and a flag indicating whether a snap occurred.
780
* \param point_type Category of points to which the source point belongs: node or bounding box.
781
* \param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
782
* \param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
783
* \param constraint The direction or line along which snapping must occur.
784
* \param tr Proposed translation; the final translation can only be calculated after snapping has occurred.
785
* \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
686
788
Inkscape::SnappedPoint SnapManager::constrainedSnapTranslation(Inkscape::SnapPreferences::PointType point_type,
701
* Try to snap a list of points to any interested snappers after they have undergone
803
* \brief Apply a scaling to a set of points and try to snap freely in 2 degrees-of-freedom
704
* \param point_type Type of points.
706
* \param s Proposed scale.
707
* \param o Origin of proposed scale.
708
* \return Snapped scale, if a snap occurred, and a flag indicating whether a snap occurred.
805
* \param point_type Category of points to which the source point belongs: node or bounding box.
806
* \param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
807
* \param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
808
* \param s Proposed scaling; the final scaling can only be calculated after snapping has occurred
809
* \param o Origin of the scaling
810
* \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
711
813
Inkscape::SnappedPoint SnapManager::freeSnapScale(Inkscape::SnapPreferences::PointType point_type,
726
* Try to snap a list of points to any interested snappers after they have undergone
727
* a scale. A snap will only occur along a line described by a
728
* Inkscape::Snapper::ConstraintLine.
828
* \brief Apply a scaling to a set of points and snap such that the aspect ratio of the selection is preserved
730
* \param point_type Type of points.
732
* \param s Proposed scale.
733
* \param o Origin of proposed scale.
734
* \return Snapped scale, if a snap occurred, and a flag indicating whether a snap occurred.
830
* \param point_type Category of points to which the source point belongs: node or bounding box.
831
* \param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
832
* \param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
833
* \param s Proposed scaling; the final scaling can only be calculated after snapping has occurred
834
* \param o Origin of the scaling
835
* \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
737
838
Inkscape::SnappedPoint SnapManager::constrainedSnapScale(Inkscape::SnapPreferences::PointType point_type,
748
849
return _snapTransformed(point_type, p, pointer, true, Geom::Point(0,0), SCALE, Geom::Point(s[Geom::X], s[Geom::Y]), o, Geom::X, true);
753
* Try to snap a list of points to any interested snappers after they have undergone
853
* \brief Apply a stretch to a set of points and snap such that the direction of the stretch is preserved
756
* \param point_type Type of points.
758
* \param s Proposed stretch.
759
* \param o Origin of proposed stretch.
855
* \param point_type Category of points to which the source point belongs: node or bounding box.
856
* \param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
857
* \param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
858
* \param s Proposed stretch; the final stretch can only be calculated after snapping has occurred
859
* \param o Origin of the stretching
760
860
* \param d Dimension in which to apply proposed stretch.
761
* \param u true if the stretch should be uniform (ie to be applied equally in both dimensions)
762
* \return Snapped stretch, if a snap occurred, and a flag indicating whether a snap occurred.
861
* \param u true if the stretch should be uniform (i.e. to be applied equally in both dimensions)
862
* \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
765
865
Inkscape::SnappedPoint SnapManager::constrainedSnapStretch(Inkscape::SnapPreferences::PointType point_type,
777
877
return _snapTransformed(point_type, p, pointer, true, Geom::Point(0,0), STRETCH, Geom::Point(s, s), o, d, u);
782
* Try to snap a list of points to any interested snappers after they have undergone
881
* \brief Apply a skew to a set of points and snap such that the direction of the skew is preserved
785
* \param point_type Type of points.
787
* \param s Proposed skew.
788
* \param o Origin of proposed skew.
883
* \param point_type Category of points to which the source point belongs: node or bounding box.
884
* \param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
885
* \param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
886
* \param constraint The direction or line along which snapping must occur.
887
* \param s Proposed skew; the final skew can only be calculated after snapping has occurred
888
* \param o Origin of the proposed skew
789
889
* \param d Dimension in which to apply proposed skew.
790
* \return Snapped skew, if a snap occurred, and a flag indicating whether a snap occurred.
890
* \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
793
893
Inkscape::SnappedPoint SnapManager::constrainedSnapSkew(Inkscape::SnapPreferences::PointType point_type,
814
914
return _snapTransformed(point_type, p, pointer, true, constraint, SKEW, s, o, d, false);
817
Inkscape::SnappedPoint SnapManager::findBestSnap(Geom::Point const &p, Inkscape::SnapSourceType const source_type, SnappedConstraints &sc, bool constrained) const
918
* \brief Given a set of possible snap targets, find the best target (which is not necessarily
919
* also the nearest target), and show the snap indicator if requested
921
* \param p Current position of the snap source
922
* \param source_type Detailed description of the source type, will be used by the snap indicator
923
* \param sc A structure holding all snap targets that have been found so far
924
* \param constrained True if the snap is constrained, e.g. for stretching or for purely horizontal translation.
925
* \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics
928
Inkscape::SnappedPoint SnapManager::findBestSnap(Geom::Point const &p,
929
Inkscape::SnapSourceType const source_type,
930
SnappedConstraints &sc,
931
bool constrained) const
925
1039
return bestSnappedPoint;
1043
* \brief Prepare the snap manager for the actual snapping, which includes building a list of snap targets
1044
* to ignore and toggling the snap indicator
1046
* There are two overloaded setup() methods, of which this one only allows for a single item to be ignored
1047
* whereas the other one will take a list of items to ignore
1049
* \param desktop Reference to the desktop to which this snap manager is attached
1050
* \param snapindicator If true then a snap indicator will be displayed automatically (when enabled in the preferences)
1051
* \param item_to_ignore This item will not be snapped to, e.g. the item that is currently being dragged. This avoids "self-snapping"
1052
* \param unselected_nodes Stationary nodes of the path that is currently being edited in the node tool and
1053
* that can be snapped too. Nodes not in this list will not be snapped to, to avoid "self-snapping". Of each
1054
* unselected node both the position (Geom::Point) and the type (Inkscape::SnapTargetType) will be stored
1055
* \param guide_to_ignore Guide that is currently being dragged and should not be snapped to
928
1058
void SnapManager::setup(SPDesktop const *desktop,
929
1059
bool snapindicator,
930
1060
SPItem const *item_to_ignore,
940
1070
_guide_to_ignore = guide_to_ignore;
1074
* \brief Prepare the snap manager for the actual snapping, which includes building a list of snap targets
1075
* to ignore and toggling the snap indicator
1077
* There are two overloaded setup() methods, of which the other one only allows for a single item to be ignored
1078
* whereas this one will take a list of items to ignore
1080
* \param desktop Reference to the desktop to which this snap manager is attached
1081
* \param snapindicator If true then a snap indicator will be displayed automatically (when enabled in the preferences)
1082
* \param items_to_ignore These items will not be snapped to, e.g. the items that are currently being dragged. This avoids "self-snapping"
1083
* \param unselected_nodes Stationary nodes of the path that is currently being edited in the node tool and
1084
* that can be snapped too. Nodes not in this list will not be snapped to, to avoid "self-snapping". Of each
1085
* unselected node both the position (Geom::Point) and the type (Inkscape::SnapTargetType) will be stored
1086
* \param guide_to_ignore Guide that is currently being dragged and should not be snapped to
943
1089
void SnapManager::setup(SPDesktop const *desktop,
944
1090
bool snapindicator,
945
1091
std::vector<SPItem const *> &items_to_ignore,
960
1106
return _named_view->document;
1110
* \brief Takes an untransformed point, applies the given transformation, and returns the transformed point. Eliminates lots of duplicated code
1112
* \param p The untransformed position of the point, paired with an identifier of the type of the snap source.
1113
* \param transformation_type Type of transformation to apply.
1114
* \param transformation Mathematical description of the transformation; details depend on the type.
1115
* \param origin Origin of the transformation, if applicable.
1116
* \param dim Dimension to which the transformation applies, if applicable.
1117
* \param uniform true if the transformation should be uniform; only applicable for stretching and scaling.
1118
* \return The position of the point after transformation
963
1121
Geom::Point SnapManager::_transformPoint(std::pair<Geom::Point, int> const &p,
964
1122
Transformation const transformation_type,
965
1123
Geom::Point const &transformation,