summaryrefslogtreecommitdiffstats
path: root/src/object-snapper.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2011-04-07 23:42:04 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2011-04-07 23:42:04 +0000
commit945ce419c806c73d70203dec33ececafbe108a92 (patch)
treecfcdb59bf47e9db7f9e01f7eebb59924bdeaea94 /src/object-snapper.cpp
parentMerge from trunk (again) (diff)
parentExtensions. SVG+media fix (see Bug #400356). (diff)
downloadinkscape-945ce419c806c73d70203dec33ececafbe108a92.tar.gz
inkscape-945ce419c806c73d70203dec33ececafbe108a92.zip
Merge from trunk
(bzr r9508.1.73)
Diffstat (limited to 'src/object-snapper.cpp')
-rw-r--r--src/object-snapper.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp
index 43651f002..1e2f71c95 100644
--- a/src/object-snapper.cpp
+++ b/src/object-snapper.cpp
@@ -84,7 +84,7 @@ void Inkscape::ObjectSnapper::_findCandidates(SPObject* parent,
bool const &first_point,
Geom::Rect const &bbox_to_snap,
bool const clip_or_mask,
- Geom::Matrix const additional_affine) const // transformation of the item being clipped / masked
+ Geom::Affine const additional_affine) const // transformation of the item being clipped / masked
{
if (!ThisSnapperMightSnap()) {
return;
@@ -198,7 +198,7 @@ void Inkscape::ObjectSnapper::_collectNodes(Inkscape::SnapSourceType const &t,
}
for (std::vector<SnapCandidateItem>::const_iterator i = _candidates->begin(); i != _candidates->end(); i++) {
- //Geom::Matrix i2doc(Geom::identity());
+ //Geom::Affine i2doc(Geom::identity());
SPItem *root_item = (*i).item;
if (SP_IS_USE((*i).item)) {
root_item = sp_use_root(SP_USE((*i).item));
@@ -378,7 +378,7 @@ void Inkscape::ObjectSnapper::_collectPaths(Geom::Point /*p*/,
for (std::vector<SnapCandidateItem>::const_iterator i = _candidates->begin(); i != _candidates->end(); i++) {
/* Transform the requested snap point to this item's coordinates */
- Geom::Matrix i2doc(Geom::identity());
+ Geom::Affine i2doc(Geom::identity());
SPItem *root_item = NULL;
/* We might have a clone at hand, so make sure we get the root item */
if (SP_IS_USE((*i).item)) {
@@ -414,8 +414,13 @@ void Inkscape::ObjectSnapper::_collectPaths(Geom::Point /*p*/,
very_complex_path = sp_nodes_in_path(SP_PATH(root_item)) > 500;
}
- if (!very_lenghty_prose && !very_complex_path) {
- SPCurve *curve = curve_for_item(root_item);
+ if (!very_lenghty_prose && !very_complex_path && root_item) {
+ SPCurve *curve = NULL;
+ if (SP_IS_SHAPE(root_item)) {
+ curve = SP_SHAPE(root_item)->getCurve();
+ } else if (SP_IS_TEXT(root_item) || SP_IS_FLOWTEXT(root_item)) {
+ curve = te_get_layout(root_item)->convertToCurves();
+ }
if (curve) {
// We will get our own copy of the pathvector, which must be freed at some point