summaryrefslogtreecommitdiffstats
path: root/src/snap-preferences.h
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2009-01-18 20:00:19 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2009-01-18 20:00:19 +0000
commit644f4f4a93a81735fb8265907533308df80d6b11 (patch)
tree47a80b1dc162b88a063b295dbae920cc2a668e93 /src/snap-preferences.h
parentsnap indicator: try a diamond shaped indicator for snapping to nodes. see how... (diff)
downloadinkscape-644f4f4a93a81735fb8265907533308df80d6b11.tar.gz
inkscape-644f4f4a93a81735fb8265907533308df80d6b11.zip
- Snap to the midpoint of shapes and bboxes
- Snap to the midpoint of paths and bbox edges - Refactor the snapping toggle, i.e. what snaps to what when toggling a specific option in the snapping toolbar PS: icons.svg has been modified, so use "make install" if needed (bzr r7144)
Diffstat (limited to 'src/snap-preferences.h')
-rw-r--r--src/snap-preferences.h39
1 files changed, 36 insertions, 3 deletions
diff --git a/src/snap-preferences.h b/src/snap-preferences.h
index a52e0cfd9..97ef3cec2 100644
--- a/src/snap-preferences.h
+++ b/src/snap-preferences.h
@@ -39,11 +39,17 @@ public:
void setSnapIntersectionGG(bool enabled) {_intersectionGG = enabled;}
void setSnapIntersectionCS(bool enabled) {_intersectionCS = enabled;}
void setSnapSmoothNodes(bool enabled) {_smoothNodes = enabled;}
- void setSnapMidpoints(bool enabled) {_midpoints = enabled;}
+ void setSnapLineMidpoints(bool enabled) {_line_midpoints = enabled;}
+ void setSnapObjectMidpoints(bool enabled) {_object_midpoints = enabled;}
+ void setSnapBBoxEdgeMidpoints(bool enabled) {_bbox_edge_midpoints = enabled;}
+ void setSnapBBoxMidpoints(bool enabled) {_bbox_midpoints = enabled;}
bool getSnapIntersectionGG() const {return _intersectionGG;}
bool getSnapIntersectionCS() const {return _intersectionCS;}
bool getSnapSmoothNodes() const {return _smoothNodes;}
- bool getSnapMidpoints() const {return _midpoints;}
+ bool getSnapLineMidpoints() const {return _line_midpoints;}
+ bool getSnapObjectMidpoints() const {return _object_midpoints;}
+ bool getSnapBBoxEdgeMidpoints() const {return _bbox_edge_midpoints;}
+ bool getSnapBBoxMidpoints() const {return _bbox_midpoints;}
void setIncludeItemCenter(bool enabled) {_include_item_center = enabled;}
bool getIncludeItemCenter() const {return _include_item_center;}
@@ -57,16 +63,43 @@ public:
void setSnapFrom(PointType t, bool s);
bool getSnapFrom(PointType t) const;
+ // These will only be used for the object snapper
+ void setSnapToItemNode(bool s) {_snap_to_itemnode = s;}
+ bool getSnapToItemNode() const {return _snap_to_itemnode;}
+ void setSnapToItemPath(bool s) {_snap_to_itempath = s;}
+ bool getSnapToItemPath() const {return _snap_to_itempath;}
+ void setSnapToBBoxNode(bool s) {_snap_to_bboxnode = s;}
+ bool getSnapToBBoxNode() const {return _snap_to_bboxnode;}
+ void setSnapToBBoxPath(bool s) {_snap_to_bboxpath = s;}
+ bool getSnapToBBoxPath() const {return _snap_to_bboxpath;}
+ void setSnapToPageBorder(bool s) {_snap_to_page_border = s;}
+ bool getSnapToPageBorder() const {return _snap_to_page_border;}
+ bool getStrictSnapping() const {return _strict_snapping;}
+
private:
bool _include_item_center; //If true, snapping nodes will also snap the item's center
bool _intersectionGG; //Consider snapping to intersections of grid and guides
bool _intersectionCS; //Consider snapping to intersections of curves
bool _smoothNodes;
- bool _midpoints;
+ bool _line_midpoints;
+ bool _object_midpoints; // the midpoint of shapes (e.g. a circle, rect, polygon) or of any other shape (at [h/2, w/2])
+ bool _bbox_edge_midpoints;
+ bool _bbox_midpoints;
bool _snap_enabled_globally; // Toggles ALL snapping
bool _snap_postponed_globally; // Hold all snapping temporarily when the mouse is moving fast
PointType _snap_from; ///< bitmap of point types that we will snap from
+ // These will only be used for the object snapper
+ bool _snap_to_itemnode;
+ bool _snap_to_itempath;
+ bool _snap_to_bboxnode;
+ bool _snap_to_bboxpath;
+ bool _snap_to_page_border;
+ //If enabled, then bbox corners will only snap to bboxes,
+ //and nodes will only snap to nodes and paths. We will not
+ //snap bbox corners to nodes, or nodes to bboxes.
+ //(snapping to grids and guides is not affected by this)
+ bool _strict_snapping;
};
}