diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 519ed2a45f79bcbfae4169c7515e362cb7e2f3d2..2ac480341a4ef469a9194ed439bff6f249a517ea 100644 (file)
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
#include "document.h"
#include "uri.h"
#include "inkscape.h"
+#include "desktop.h"
#include "desktop-handles.h"
#include "style.h"
#include "sp-item-rm-unsatisfied-cns.h"
#include "sp-pattern.h"
#include "sp-switch.h"
+#include "sp-guide-constraint.h"
#include "gradient-chemistry.h"
#include "preferences.h"
#include "conn-avoid-ref.h"
this->avoidRef = new SPAvoidRef(this);
+ new (&this->constraints) std::vector<SPGuideConstraint>();
+
new (&this->_transformed_signal) sigc::signal<void, Geom::Matrix const *, SPItem *>();
}
@@ -969,7 +973,7 @@ void sp_item_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPref
// Get the snappoints at the item's center
if (snapprefs != NULL && snapprefs->getIncludeItemCenter()) {
- *p = item->getCenter();
+ *p = item->getCenter();
}
// Get the snappoints of clipping paths and mask, if any
@@ -978,6 +982,7 @@ void sp_item_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPref
clips_and_masks.push_back(SP_OBJECT(item->clip_ref->getObject()));
clips_and_masks.push_back(SP_OBJECT(item->mask_ref->getObject()));
+ SPDesktop *desktop = inkscape_active_desktop();
for (std::list<SPObject const *>::const_iterator o = clips_and_masks.begin(); o != clips_and_masks.end(); o++) {
if (*o) {
// obj is a group object, the children are the actual clippers
@@ -990,7 +995,7 @@ void sp_item_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPref
for (std::vector<Geom::Point>::const_iterator p_orig = p_clip_or_mask.begin(); p_orig != p_clip_or_mask.end(); p_orig++) {
// All snappoints are in desktop coordinates, but the item's transformation is
// in document coordinates. Hence the awkward construction below
- *p = (*p_orig) * matrix_to_desktop (matrix_from_desktop (item->transform, item), item);
+ *p = desktop->dt2doc(*p_orig) * sp_item_i2d_affine(item);
}
}
}
g_free (s);
s = snew;
}
- if (SP_OBJECT_STYLE(item) && SP_OBJECT_STYLE(item)->filter.href) {
- gchar *snew = g_strdup_printf (_("%s; <i>filtered</i>"), s);
+ if (SP_OBJECT_STYLE(item) && SP_OBJECT_STYLE(item)->filter.href && SP_OBJECT_STYLE(item)->filter.href->getObject()) {
+ const gchar *label = SP_OBJECT_STYLE(item)->filter.href->getObject()->label();
+ gchar *snew;
+ if (label) {
+ snew = g_strdup_printf (_("%s; <i>filtered (%s)</i>"), s, label);
+ } else {
+ snew = g_strdup_printf (_("%s; <i>filtered</i>"), s);
+ }
g_free (s);
s = snew;
}
return ret;
}
-/**
- * Converts a matrix \a m into the desktop coords of the \a item.
- * Will become a noop when we eliminate the coordinate flipping.
- */
-Geom::Matrix matrix_to_desktop(Geom::Matrix const m, SPItem const *item)
-{
- Geom::Matrix const ret(m
- * Geom::Translate(0, -sp_document_height(SP_OBJECT_DOCUMENT(item)))
- * Geom::Scale(1, -1));
- return ret;
-}
-
-/**
- * Converts a matrix \a m from the desktop coords of the \a item.
- * Will become a noop when we eliminate the coordinate flipping.
- */
-Geom::Matrix matrix_from_desktop(Geom::Matrix const m, SPItem const *item)
-{
- Geom::Matrix const ret(Geom::Scale(1, -1)
- * Geom::Translate(0, sp_document_height(SP_OBJECT_DOCUMENT(item)))
- * m);
- return ret;
-}
-
void sp_item_set_i2d_affine(SPItem *item, Geom::Matrix const &i2dt)
{
g_return_if_fail( item != NULL );