summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2011-07-17 19:47:09 +0000
committerJohan Engelen <goejendaagh@zonnet.nl>2011-07-17 19:47:09 +0000
commiteed6e9c2c229b10911a23976c47da79fc70a5b87 (patch)
treecf0be87e45680dac877bec1cd628b86fe020cf7e /src
parentFix build failures on make check (diff)
downloadinkscape-eed6e9c2c229b10911a23976c47da79fc70a5b87.tar.gz
inkscape-eed6e9c2c229b10911a23976c47da79fc70a5b87.zip
- rename SPItem::i2d_affine to i2dt_affine, to clarify that it is item-to-desktop, not item-to-document. This should make it easier to spot bugs.
- tag some instances where the document-to-desktop transform has been hardcoded (bzr r10466)
Diffstat (limited to 'src')
-rw-r--r--src/arc-context.cpp2
-rw-r--r--src/box3d.cpp4
-rw-r--r--src/connector-context.cpp14
-rw-r--r--src/desktop-style.cpp10
-rw-r--r--src/desktop.cpp3
-rw-r--r--src/dialogs/export.cpp2
-rw-r--r--src/dialogs/spellcheck.cpp6
-rw-r--r--src/draw-context.cpp4
-rw-r--r--src/extension/internal/cairo-renderer.cpp6
-rw-r--r--src/extension/internal/emf-win32-print.cpp4
-rw-r--r--src/extension/internal/javafx-out.cpp8
-rw-r--r--src/extension/internal/latex-pstricks.cpp2
-rw-r--r--src/extension/internal/latex-text-renderer.cpp4
-rw-r--r--src/extension/internal/odf.cpp6
-rw-r--r--src/extension/internal/pov-out.cpp2
-rw-r--r--src/filter-chemistry.cpp6
-rw-r--r--src/gradient-chemistry.cpp4
-rw-r--r--src/interface.cpp4
-rw-r--r--src/knot-holder-entity.cpp12
-rw-r--r--src/knotholder.cpp6
-rw-r--r--src/live_effects/lpe-mirror_symmetry.cpp2
-rw-r--r--src/live_effects/parameter/path.cpp2
-rw-r--r--src/main.cpp2
-rw-r--r--src/object-edit.cpp8
-rw-r--r--src/object-snapper.cpp6
-rw-r--r--src/selcue.cpp2
-rw-r--r--src/selection-chemistry.cpp14
-rw-r--r--src/seltrans.cpp4
-rw-r--r--src/sp-ellipse.cpp10
-rw-r--r--src/sp-flowtext.cpp4
-rw-r--r--src/sp-image.cpp2
-rw-r--r--src/sp-item-notify-moveto.cpp2
-rw-r--r--src/sp-item-transform.cpp8
-rw-r--r--src/sp-item.cpp38
-rw-r--r--src/sp-item.h2
-rw-r--r--src/sp-line.cpp6
-rw-r--r--src/sp-path.cpp4
-rw-r--r--src/sp-rect.cpp20
-rw-r--r--src/sp-shape.cpp20
-rw-r--r--src/sp-spiral.cpp4
-rw-r--r--src/sp-star.cpp4
-rw-r--r--src/sp-text.cpp4
-rw-r--r--src/splivarot.cpp2
-rw-r--r--src/spray-context.cpp4
-rw-r--r--src/text-context.cpp6
-rw-r--r--src/text-editing.cpp2
-rw-r--r--src/tweak-context.cpp4
-rw-r--r--src/ui/dialog/align-and-distribute.cpp4
-rw-r--r--src/ui/dialog/filedialogimpl-win32.cpp2
-rw-r--r--src/ui/dialog/tile.cpp2
-rw-r--r--src/ui/tool/node-tool.cpp2
-rw-r--r--src/ui/tool/path-manipulator.cpp4
-rw-r--r--src/unclump.cpp8
53 files changed, 158 insertions, 159 deletions
diff --git a/src/arc-context.cpp b/src/arc-context.cpp
index 32a0bab40..96f5e1cff 100644
--- a/src/arc-context.cpp
+++ b/src/arc-context.cpp
@@ -445,7 +445,7 @@ static void sp_arc_drag(SPArcContext *ac, Geom::Point pt, guint state)
Geom::Point c = r.midpoint();
if (!ctrl_save) {
if (fabs(dir[Geom::X]) > 1E-6 && fabs(dir[Geom::Y]) > 1E-6) {
- Geom::Affine const i2d ((ac->item)->i2d_affine ());
+ Geom::Affine const i2d ( (ac->item)->i2dt_affine() );
Geom::Point new_dir = pt * i2d - c;
new_dir[Geom::X] *= dir[Geom::Y] / dir[Geom::X];
double lambda = new_dir.length() / dir[Geom::Y];
diff --git a/src/box3d.cpp b/src/box3d.cpp
index efd4054e1..ea1e35982 100644
--- a/src/box3d.cpp
+++ b/src/box3d.cpp
@@ -388,7 +388,7 @@ box3d_get_corner_screen (SPBox3D const *box, guint id, bool item_coords) {
if (!box3d_get_perspective(box)) {
return Geom::Point (Geom::infinity(), Geom::infinity());
}
- Geom::Affine const i2d(box->i2d_affine ());
+ Geom::Affine const i2d(box->i2dt_affine ());
if (item_coords) {
return box3d_get_perspective(box)->perspective_impl->tmat.image(proj_corner).affine() * i2d.inverse();
} else {
@@ -412,7 +412,7 @@ box3d_get_center_screen (SPBox3D *box) {
if (!box3d_get_perspective(box)) {
return Geom::Point (Geom::infinity(), Geom::infinity());
}
- Geom::Affine const i2d(box->i2d_affine ());
+ Geom::Affine const i2d( box->i2dt_affine() );
return box3d_get_perspective(box)->perspective_impl->tmat.image(proj_center).affine() * i2d.inverse();
}
diff --git a/src/connector-context.cpp b/src/connector-context.cpp
index 2aa9c41ee..ecc8cdaad 100644
--- a/src/connector-context.cpp
+++ b/src/connector-context.cpp
@@ -977,7 +977,7 @@ connector_handle_motion_notify(SPConnectorContext *const cc, GdkEventMotion cons
m.unSetup();
// Update the hidden path
- Geom::Affine i2d = (cc->clickeditem)->i2d_affine();
+ Geom::Affine i2d ( (cc->clickeditem)->i2dt_affine() );
Geom::Affine d2i = i2d.inverse();
SPPath *path = SP_PATH(cc->clickeditem);
SPCurve *curve = path->original_curve ? path->original_curve : path->curve;
@@ -1607,7 +1607,7 @@ endpt_handler(SPKnot */*knot*/, GdkEvent *event, SPConnectorContext *cc)
// Show the red path for dragging.
cc->red_curve = SP_PATH(cc->clickeditem)->original_curve ? SP_PATH(cc->clickeditem)->original_curve->copy() : SP_PATH(cc->clickeditem)->curve->copy();
- Geom::Affine i2d = (cc->clickeditem)->i2d_affine();
+ Geom::Affine i2d = (cc->clickeditem)->i2dt_affine();
cc->red_curve->transform(i2d);
sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(cc->red_bpath), cc->red_curve);
@@ -1766,7 +1766,7 @@ cc_set_active_conn(SPConnectorContext *cc, SPItem *item)
g_assert( SP_IS_PATH(item) );
SPCurve *curve = SP_PATH(item)->original_curve ? SP_PATH(item)->original_curve : SP_PATH(item)->curve;
- Geom::Affine i2d = item->i2d_affine();
+ Geom::Affine i2dt = item->i2dt_affine();
if (cc->active_conn == item)
{
@@ -1780,10 +1780,10 @@ cc_set_active_conn(SPConnectorContext *cc, SPItem *item)
else
{
// Just adjust handle positions.
- Geom::Point startpt = *(curve->first_point()) * i2d;
+ Geom::Point startpt = *(curve->first_point()) * i2dt;
sp_knot_set_position(cc->endpt_handle[0], startpt, 0);
- Geom::Point endpt = *(curve->last_point()) * i2d;
+ Geom::Point endpt = *(curve->last_point()) * i2dt;
sp_knot_set_position(cc->endpt_handle[1], endpt, 0);
}
@@ -1855,10 +1855,10 @@ cc_set_active_conn(SPConnectorContext *cc, SPItem *item)
return;
}
- Geom::Point startpt = *(curve->first_point()) * i2d;
+ Geom::Point startpt = *(curve->first_point()) * i2dt;
sp_knot_set_position(cc->endpt_handle[0], startpt, 0);
- Geom::Point endpt = *(curve->last_point()) * i2d;
+ Geom::Point endpt = *(curve->last_point()) * i2dt;
sp_knot_set_position(cc->endpt_handle[1], endpt, 0);
sp_knot_show(cc->endpt_handle[0]);
diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp
index 88ad9ca57..1cad282b3 100644
--- a/src/desktop-style.cpp
+++ b/src/desktop-style.cpp
@@ -420,7 +420,7 @@ stroke_average_width (GSList const *objects)
if (!SP_IS_ITEM (l->data))
continue;
- Geom::Affine i2d = SP_ITEM(l->data)->i2d_affine();
+ Geom::Affine i2dt = SP_ITEM(l->data)->i2dt_affine();
SPObject *object = SP_OBJECT(l->data);
@@ -431,7 +431,7 @@ stroke_average_width (GSList const *objects)
notstroked = false;
}
- avgwidth += object->style->stroke_width.computed * i2d.descrim();
+ avgwidth += object->style->stroke_width.computed * i2dt.descrim();
}
if (notstroked)
@@ -725,7 +725,7 @@ objects_query_strokewidth (GSList *objects, SPStyle *style_res)
noneSet &= style->stroke.isNone();
- Geom::Affine i2d = SP_ITEM(obj)->i2d_affine();
+ Geom::Affine i2d = SP_ITEM(obj)->i2dt_affine();
double sw = style->stroke_width.computed * i2d.descrim();
if (prev_sw != -1 && fabs(sw - prev_sw) > 1e-3)
@@ -961,7 +961,7 @@ objects_query_fontnumbers (GSList *objects, SPStyle *style_res)
}
texts ++;
- size += style->font_size.computed * Geom::Affine(SP_ITEM(obj)->i2d_affine()).descrim(); /// \todo FIXME: we assume non-% units here
+ size += style->font_size.computed * Geom::Affine(SP_ITEM(obj)->i2dt_affine()).descrim(); /// \todo FIXME: we assume non-% units here
if (style->letter_spacing.normal) {
if (!different && (letterspacing_prev == 0 || letterspacing_prev == letterspacing)) {
@@ -1428,7 +1428,7 @@ objects_query_blur (GSList *objects, SPStyle *style_res)
continue;
}
- Geom::Affine i2d = SP_ITEM(obj)->i2d_affine();
+ Geom::Affine i2d = SP_ITEM(obj)->i2dt_affine();
items ++;
diff --git a/src/desktop.cpp b/src/desktop.cpp
index 7034e85b6..5e968b08b 100644
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
@@ -1816,8 +1816,7 @@ Geom::Affine SPDesktop::doc2dt() const
Geom::Affine SPDesktop::dt2doc() const
{
- // doc2dt is its own inverse
- return _doc2dt;
+ return _doc2dt.inverse();
}
Geom::Point SPDesktop::doc2dt(Geom::Point const &p) const
diff --git a/src/dialogs/export.cpp b/src/dialogs/export.cpp
index 77447b658..c839c376b 100644
--- a/src/dialogs/export.cpp
+++ b/src/dialogs/export.cpp
@@ -1130,7 +1130,7 @@ sp_export_export_clicked (GtkButton */*button*/, GtkObject *base)
}
Geom::OptRect area;
- item->invoke_bbox( area, item->i2d_affine(), TRUE );
+ item->invoke_bbox( area, item->i2dt_affine(), TRUE );
if (area) {
gint width = (gint) (area->width() * dpi / PX_PER_IN + 0.5);
gint height = (gint) (area->height() * dpi / PX_PER_IN + 0.5);
diff --git a/src/dialogs/spellcheck.cpp b/src/dialogs/spellcheck.cpp
index 5de0bc6fe..d0de6ad20 100644
--- a/src/dialogs/spellcheck.cpp
+++ b/src/dialogs/spellcheck.cpp
@@ -243,8 +243,8 @@ gint compare_text_bboxes (gconstpointer a, gconstpointer b)
SPItem *i1 = SP_ITEM(a);
SPItem *i2 = SP_ITEM(b);
- Geom::OptRect bbox1 = i1->getBounds(i1->i2d_affine());
- Geom::OptRect bbox2 = i2->getBounds(i2->i2d_affine());
+ Geom::OptRect bbox1 = i1->getBounds(i1->i2dt_affine());
+ Geom::OptRect bbox2 = i2->getBounds(i2->i2dt_affine());
if (!bbox1 || !bbox2) {
return 0;
}
@@ -577,7 +577,7 @@ spellcheck_next_word()
// draw rect
std::vector<Geom::Point> points =
- _layout->createSelectionShape(_begin_w, _end_w, _text->i2d_affine());
+ _layout->createSelectionShape(_begin_w, _end_w, _text->i2dt_affine());
Geom::Point tl, br;
tl = br = points.front();
for (unsigned i = 0 ; i < points.size() ; i ++) {
diff --git a/src/draw-context.cpp b/src/draw-context.cpp
index 4dd58afa7..5d324754f 100644
--- a/src/draw-context.cpp
+++ b/src/draw-context.cpp
@@ -439,7 +439,7 @@ spdc_attach_selection(SPDrawContext *dc, Inkscape::Selection */*sel*/)
/* Curve list */
/* We keep it in desktop coordinates to eliminate calculation errors */
SPCurve *norm = sp_path_get_curve_for_edit (SP_PATH(item));
- norm->transform((dc->white_item)->i2d_affine());
+ norm->transform((dc->white_item)->i2dt_affine());
g_return_if_fail( norm != NULL );
dc->white_curves = g_slist_reverse(norm->split());
norm->unref();
@@ -821,7 +821,7 @@ void spdc_create_single_dot(SPEventContext *ec, Geom::Point const &pt, char cons
current stroke width, multiplied by the amount specified in the preferences */
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- Geom::Affine const i2d (item->i2d_affine ());
+ Geom::Affine const i2d (item->i2dt_affine ());
Geom::Point pp = pt;
double rad = 0.5 * prefs->getDouble(tool_path + "/dot-size", 3.0);
if (event_state & GDK_MOD1_MASK) {
diff --git a/src/extension/internal/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp
index 3b16df96c..7eb7881dc 100644
--- a/src/extension/internal/cairo-renderer.cpp
+++ b/src/extension/internal/cairo-renderer.cpp
@@ -454,7 +454,7 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx)
// Get the bounding box of the selection in document coordinates.
Geom::OptRect bbox =
- item->getBounds(item->i2d_affine(), SPItem::RENDERING_BBOX);
+ item->getBounds(item->i2dt_affine(), SPItem::RENDERING_BBOX);
// no bbox, e.g. empty group
if (!bbox) {
@@ -502,7 +502,7 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx)
(Geom::Affine)(Geom::Translate (shift_x, shift_y));
// ctx matrix already includes item transformation. We must substract.
- Geom::Affine t_item = item->i2d_affine ();
+ Geom::Affine t_item = item->i2dt_affine ();
Geom::Affine t = t_on_document * t_item.inverse();
// Do the export
@@ -633,7 +633,7 @@ CairoRenderer::setupDocument(CairoRenderContext *ctx, SPDocument *doc, bool page
d.x1 = doc->getWidth();
d.y1 = doc->getHeight();
} else {
- base->invoke_bbox( &d, base->i2d_affine(), TRUE, SPItem::RENDERING_BBOX);
+ base->invoke_bbox( &d, base->i2dt_affine(), TRUE, SPItem::RENDERING_BBOX);
}
if (ctx->_vector_based_target) {
diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp
index e5d1b0681..7ed0f6fcf 100644
--- a/src/extension/internal/emf-win32-print.cpp
+++ b/src/extension/internal/emf-win32-print.cpp
@@ -144,7 +144,7 @@ PrintEmfWin32::begin (Inkscape::Extension::Print *mod, SPDocument *doc)
d.y1 = _height;
} else {
SPItem* doc_item = doc->getRoot();
- doc_item->invoke_bbox(&d, doc_item->i2d_affine(), TRUE);
+ doc_item->invoke_bbox(&d, doc_item->i2dt_affine(), TRUE);
}
d.x0 *= IN_PER_PX;
@@ -226,7 +226,7 @@ PrintEmfWin32::begin (Inkscape::Extension::Print *mod, SPDocument *doc)
g_free(local_fn);
g_free(unicode_fn);
- m_tr_stack.push( Geom::Scale(1, -1) * Geom::Translate(0, doc->getHeight()));
+ m_tr_stack.push( Geom::Scale(1, -1) * Geom::Translate(0, doc->getHeight())); /// @fixme hardcoded doc2dt transform
return 0;
}
diff --git a/src/extension/internal/javafx-out.cpp b/src/extension/internal/javafx-out.cpp
index 8399d602f..74b6a69ee 100644
--- a/src/extension/internal/javafx-out.cpp
+++ b/src/extension/internal/javafx-out.cpp
@@ -492,8 +492,8 @@ bool JavaFXOutput::doCurve(SPItem *item, const String &id)
}
// convert the path to only lineto's and cubic curveto's:
- Geom::Scale yflip(1.0, -1.0);
- Geom::Affine tf = item->i2d_affine() * yflip;
+ Geom::Scale yflip(1.0, -1.0); /// @fixme hardcoded desktop transform!
+ Geom::Affine tf = item->i2dt_affine() * yflip;
Geom::PathVector pathv = pathv_to_linear_and_cubic_beziers( curve->get_pathvector() * tf );
//Count the NR_CURVETOs/LINETOs (including closing line segment)
@@ -634,8 +634,8 @@ bool JavaFXOutput::doCurve(SPItem *item, const String &id)
}
// convert the path to only lineto's and cubic curveto's:
- Geom::Scale yflip(1.0, -1.0);
- Geom::Affine tf = item->i2d_affine() * yflip;
+ Geom::Scale yflip(1.0, -1.0); /// @fixme hardcoded desktop transform
+ Geom::Affine tf = item->i2dt_affine() * yflip;
Geom::PathVector pathv = pathv_to_linear_and_cubic_beziers( curve->get_pathvector() * tf );
//Count the NR_CURVETOs/LINETOs (including closing line segment)
diff --git a/src/extension/internal/latex-pstricks.cpp b/src/extension/internal/latex-pstricks.cpp
index e09e7c024..18950295c 100644
--- a/src/extension/internal/latex-pstricks.cpp
+++ b/src/extension/internal/latex-pstricks.cpp
@@ -141,7 +141,7 @@ PrintLatex::begin (Inkscape::Extension::Print *mod, SPDocument *doc)
os << "\\begin{pspicture}(" << doc->getWidth() << "," << doc->getHeight() << ")\n";
}
- m_tr_stack.push( Geom::Scale(1, -1) * Geom::Translate(0, doc->getHeight()));
+ m_tr_stack.push( Geom::Scale(1, -1) * Geom::Translate(0, doc->getHeight())); /// @fixme hardcoded doc2dt transform
return fprintf(_stream, "%s", os.str().c_str());
}
diff --git a/src/extension/internal/latex-text-renderer.cpp b/src/extension/internal/latex-text-renderer.cpp
index 818f39f68..02f0823d9 100644
--- a/src/extension/internal/latex-text-renderer.cpp
+++ b/src/extension/internal/latex-text-renderer.cpp
@@ -593,7 +593,7 @@ LaTeXTextRenderer::setupDocument(SPDocument *doc, bool pageBoundingBox, SPItem *
d = Geom::Rect( Geom::Point(0,0),
Geom::Point(doc->getWidth(), doc->getHeight()) );
} else {
- base->invoke_bbox( d, base->i2d_affine(), TRUE, SPItem::RENDERING_BBOX);
+ base->invoke_bbox( d, base->i2dt_affine(), TRUE, SPItem::RENDERING_BBOX);
}
if (!d) {
g_message("LaTeXTextRenderer: could not retrieve boundingbox.");
@@ -612,7 +612,7 @@ LaTeXTextRenderer::setupDocument(SPDocument *doc, bool pageBoundingBox, SPItem *
}
// flip y-axis
- push_transform( Geom::Scale(1,-1) * Geom::Translate(0, doc->getHeight()) );
+ push_transform( Geom::Scale(1,-1) * Geom::Translate(0, doc->getHeight()) ); /// @fixme hardcoded desktop transform!
// write the info to LaTeX
Inkscape::SVGOStringStream os;
diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp
index 6a350ab48..568c804a0 100644
--- a/src/extension/internal/odf.cpp
+++ b/src/extension/internal/odf.cpp
@@ -946,10 +946,10 @@ static Glib::ustring formatTransform(Geom::Affine &tf)
static Geom::Affine getODFTransform(const SPItem *item)
{
//### Get SVG-to-ODF transform
- Geom::Affine tf (item->i2d_affine());
+ Geom::Affine tf (item->i2dt_affine());
//Flip Y into document coordinates
double doc_height = SP_ACTIVE_DOCUMENT->getHeight();
- Geom::Affine doc2dt_tf = Geom::Affine(Geom::Scale(1.0, -1.0));
+ Geom::Affine doc2dt_tf = Geom::Affine(Geom::Scale(1.0, -1.0)); /// @fixme hardcoded desktop transform
doc2dt_tf = doc2dt_tf * Geom::Affine(Geom::Translate(0, doc_height));
tf = tf * doc2dt_tf;
tf = tf * Geom::Affine(Geom::Scale(pxToCm));
@@ -986,7 +986,7 @@ static Geom::OptRect getODFBoundingBox(const SPItem *item)
*/
static Geom::Affine getODFItemTransform(const SPItem *item)
{
- Geom::Affine itemTransform (Geom::Scale(1, -1));
+ Geom::Affine itemTransform (Geom::Scale(1, -1)); /// @fixme hardcoded doc2dt transform?
itemTransform = itemTransform * (Geom::Affine)item->transform;
itemTransform = itemTransform * Geom::Scale(1, -1);
return itemTransform;
diff --git a/src/extension/internal/pov-out.cpp b/src/extension/internal/pov-out.cpp
index 382f8cbfb..a29aade35 100644
--- a/src/extension/internal/pov-out.cpp
+++ b/src/extension/internal/pov-out.cpp
@@ -301,7 +301,7 @@ bool PovOutput::doCurve(SPItem *item, const String &id)
povShapes.push_back(shapeInfo); //passed all tests. save the info
// convert the path to only lineto's and cubic curveto's:
- Geom::Affine tf = item->i2d_affine();
+ Geom::Affine tf = item->i2dt_affine();
Geom::PathVector pathv = pathv_to_linear_and_cubic_beziers( curve->get_pathvector() * tf );
/*
diff --git a/src/filter-chemistry.cpp b/src/filter-chemistry.cpp
index b78b96c02..e98905439 100644
--- a/src/filter-chemistry.cpp
+++ b/src/filter-chemistry.cpp
@@ -328,9 +328,9 @@ new_filter_simple_from_item (SPDocument *document, SPItem *item, const char *mod
width = height = 0;
}
- Geom::Affine i2d (item->i2d_affine () );
+ Geom::Affine i2dt (item->i2dt_affine () );
- return (new_filter_blend_gaussian_blur (document, mode, radius, i2d.descrim(), i2d.expansionX(), i2d.expansionY(), width, height));
+ return (new_filter_blend_gaussian_blur (document, mode, radius, i2dt.descrim(), i2dt.expansionX(), i2dt.expansionY(), width, height));
}
/**
@@ -363,7 +363,7 @@ SPFilter *modify_filter_gaussian_blur_from_item(SPDocument *document, SPItem *it
}
// Determine the required standard deviation value
- Geom::Affine i2d (item->i2d_affine ());
+ Geom::Affine i2d (item->i2dt_affine ());
double expansion = i2d.descrim();
double stdDeviation = radius;
if (expansion != 0)
diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp
index 642ddba5b..f803d7bf8 100644
--- a/src/gradient-chemistry.cpp
+++ b/src/gradient-chemistry.cpp
@@ -789,7 +789,7 @@ void sp_item_gradient_set_coords(SPItem *item, guint point_type, guint point_i,
gradient = sp_gradient_convert_to_userspace (gradient, item, fill_or_stroke? "fill" : "stroke");
- Geom::Affine i2d (item->i2d_affine ());
+ Geom::Affine i2d (item->i2dt_affine ());
Geom::Point p = p_w * i2d.inverse();
p *= (gradient->gradientTransform).inverse();
// now p is in gradient's original coordinates
@@ -1070,7 +1070,7 @@ Geom::Point sp_item_gradient_get_coords(SPItem *item, guint point_type, guint po
bbox->min()[Geom::X], bbox->min()[Geom::Y]);
}
}
- p *= Geom::Affine(gradient->gradientTransform) * (Geom::Affine)item->i2d_affine();
+ p *= Geom::Affine(gradient->gradientTransform) * (Geom::Affine)item->i2dt_affine();
return p;
}
diff --git a/src/interface.cpp b/src/interface.cpp
index 9aa5cad31..25153097d 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -1261,7 +1261,7 @@ sp_ui_drag_data_received(GtkWidget *widget,
( !item->style->stroke.isNone() ?
desktop->current_zoom() *
item->style->stroke_width.computed *
- item->i2d_affine().descrim() * 0.5
+ item->i2dt_affine().descrim() * 0.5
: 0.0)
+ prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100);
@@ -1364,7 +1364,7 @@ sp_ui_drag_data_received(GtkWidget *widget,
( !item->style->stroke.isNone() ?
desktop->current_zoom() *
item->style->stroke_width.computed *
- item->i2d_affine().descrim() * 0.5
+ item->i2dt_affine().descrim() * 0.5
: 0.0)
+ prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100);
diff --git a/src/knot-holder-entity.cpp b/src/knot-holder-entity.cpp
index 128ca281e..835ce7550 100644
--- a/src/knot-holder-entity.cpp
+++ b/src/knot-holder-entity.cpp
@@ -75,9 +75,9 @@ KnotHolderEntity::~KnotHolderEntity()
void
KnotHolderEntity::update_knot()
{
- Geom::Affine const i2d(item->i2d_affine());
+ Geom::Affine const i2dt(item->i2dt_affine());
- Geom::Point dp(knot_get() * i2d);
+ Geom::Point dp(knot_get() * i2dt);
_moved_connection.block();
sp_knot_set_position(knot, dp, SP_KNOT_STATE_NORMAL);
@@ -87,21 +87,21 @@ KnotHolderEntity::update_knot()
Geom::Point
KnotHolderEntity::snap_knot_position(Geom::Point const &p)
{
- Geom::Affine const i2d (item->i2d_affine());
- Geom::Point s = p * i2d;
+ Geom::Affine const i2dt (item->i2dt_affine());
+ Geom::Point s = p * i2dt;
SnapManager &m = desktop->namedview->snap_manager;
m.setup(desktop, true, item);
m.freeSnapReturnByRef(s, Inkscape::SNAPSOURCE_NODE_HANDLE);
m.unSetup();
- return s * i2d.inverse();
+ return s * i2dt.inverse();
}
Geom::Point
KnotHolderEntity::snap_knot_position_constrained(Geom::Point const &p, Inkscape::Snapper::SnapConstraint const &constraint)
{
- Geom::Affine const i2d (item->i2d_affine());
+ Geom::Affine const i2d (item->i2dt_affine());
Geom::Point s = p * i2d;
SnapManager &m = desktop->namedview->snap_manager;
diff --git a/src/knotholder.cpp b/src/knotholder.cpp
index 59059c2a8..c26082baa 100644
--- a/src/knotholder.cpp
+++ b/src/knotholder.cpp
@@ -85,8 +85,6 @@ KnotHolder::~KnotHolder() {
void
KnotHolder::update_knots()
{
- Geom::Affine const i2d(item->i2d_affine());
-
for(std::list<KnotHolderEntity *>::iterator i = entity.begin(); i != entity.end(); ++i) {
KnotHolderEntity *e = *i;
e->update_knot();
@@ -165,8 +163,8 @@ KnotHolder::knot_moved_handler(SPKnot *knot, Geom::Point const &p, guint state)
for(std::list<KnotHolderEntity *>::iterator i = this->entity.begin(); i != this->entity.end(); ++i) {
KnotHolderEntity *e = *i;
if (e->knot == knot) {
- Geom::Point const q = p * item->i2d_affine().inverse();
- e->knot_set(q, e->knot->drag_origin * item->i2d_affine().inverse(), state);
+ Geom::Point const q = p * item->i2dt_affine().inverse();
+ e->knot_set(q, e->knot->drag_origin * item->i2dt_affine().inverse(), state);
break;
}
}
diff --git a/src/live_effects/lpe-mirror_symmetry.cpp b/src/live_effects/lpe-mirror_symmetry.cpp
index e64cd0905..02d24752b 100644
--- a/src/live_effects/lpe-mirror_symmetry.cpp
+++ b/src/live_effects/lpe-mirror_symmetry.cpp
@@ -45,7 +45,7 @@ LPEMirrorSymmetry::doOnApply (SPLPEItem *lpeitem)
{
using namespace Geom;
- Geom::Affine t = lpeitem->i2d_affine();
+ Geom::Affine t = lpeitem->i2dt_affine();
Geom::Rect bbox = *lpeitem->getBounds(t); // fixme: what happens if getBounds does not return a valid rect?
Point A(bbox.left(), bbox.bottom());
diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp
index bd9748fd6..32da0a426 100644
--- a/src/live_effects/parameter/path.cpp
+++ b/src/live_effects/parameter/path.cpp
@@ -208,7 +208,7 @@ PathParam::param_editOncanvas(SPItem *item, SPDesktop * dt)
ShapeRecord r;
r.role = SHAPE_ROLE_LPE_PARAM;
- r.edit_transform = item->i2d_affine(); // TODO is it right?
+ r.edit_transform = item->i2dt_affine(); // TODO is it right?
if (!href) {
r.item = reinterpret_cast<SPItem*>(param_effect->getLPEObj());
r.lpe_key = param_key;
diff --git a/src/main.cpp b/src/main.cpp
index 1614e97f7..ace99f519 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1321,7 +1321,7 @@ sp_do_export_png(SPDocument *doc)
// write object bbox to area
doc->ensureUpToDate();
Geom::OptRect areaMaybe;
- static_cast<SPItem *>(o_area)->invoke_bbox( areaMaybe, static_cast<SPItem *>(o_area)->i2d_affine(), TRUE);
+ static_cast<SPItem *>(o_area)->invoke_bbox( areaMaybe, static_cast<SPItem *>(o_area)->i2dt_affine(), TRUE);
if (areaMaybe) {
area = *areaMaybe;
} else {
diff --git a/src/object-edit.cpp b/src/object-edit.cpp
index 28c8d44db..f042d2cf2 100644
--- a/src/object-edit.cpp
+++ b/src/object-edit.cpp
@@ -474,7 +474,7 @@ Box3DKnotHolderEntity::knot_set_generic(SPItem *item, unsigned int knot_id, Geom
g_assert(item != NULL);
SPBox3D *box = SP_BOX3D(item);
- Geom::Affine const i2d (item->i2d_affine ());
+ Geom::Affine const i2dt (item->i2dt_affine ());
Box3D::Axis movement;
if ((knot_id < 4) != (state & GDK_SHIFT_MASK)) {
@@ -483,7 +483,7 @@ Box3DKnotHolderEntity::knot_set_generic(SPItem *item, unsigned int knot_id, Geom
movement = Box3D::Z;
}
- box3d_set_corner (box, knot_id, s * i2d, movement, (state & GDK_CONTROL_MASK));
+ box3d_set_corner (box, knot_id, s * i2dt, movement, (state & GDK_CONTROL_MASK));
box3d_set_z_orders(box);
box3d_position_set(box);
}
@@ -650,9 +650,9 @@ Box3DKnotHolderEntityCenter::knot_set(Geom::Point const &new_pos, Geom::Point co
Geom::Point const s = snap_knot_position(new_pos);
SPBox3D *box = SP_BOX3D(item);
- Geom::Affine const i2d (item->i2d_affine ());
+ Geom::Affine const i2dt (item->i2dt_affine ());
- box3d_set_center (SP_BOX3D(item), s * i2d, origin * i2d, !(state & GDK_SHIFT_MASK) ? Box3D::XY : Box3D::Z,
+ box3d_set_center (SP_BOX3D(item), s * i2dt, origin * i2dt, !(state & GDK_SHIFT_MASK) ? Box3D::XY : Box3D::Z,
state & GDK_CONTROL_MASK);
box3d_set_z_orders(box);
diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp
index cb0935891..1267eda37 100644
--- a/src/object-snapper.cpp
+++ b/src/object-snapper.cpp
@@ -147,7 +147,7 @@ void Inkscape::ObjectSnapper::_findCandidates(SPObject* parent,
item->i2doc_affine() * additional_affine * _snapmanager->getDesktop()->doc2dt(),
true);
} else {
- item->invoke_bbox( bbox_of_item, item->i2d_affine(), true);
+ item->invoke_bbox( bbox_of_item, item->i2dt_affine(), true);
}
if (bbox_of_item) {
// See if the item is within range
@@ -406,7 +406,7 @@ void Inkscape::ObjectSnapper::_collectPaths(Geom::Point /*p*/,
Inkscape::Text::Layout const *layout = te_get_layout((SPItem *) root_item);
if (layout != NULL && layout->outputExists()) {
Geom::PathVector *pv = new Geom::PathVector();
- pv->push_back(layout->baseline() * root_item->i2d_affine() * (*i).additional_affine * _snapmanager->getDesktop()->doc2dt());
+ pv->push_back(layout->baseline() * root_item->i2dt_affine() * (*i).additional_affine * _snapmanager->getDesktop()->doc2dt());
_paths_to_snap_to->push_back(Inkscape::SnapCandidatePath(pv, SNAPTARGET_TEXT_BASELINE, Geom::OptRect()));
}
}
@@ -432,7 +432,7 @@ void Inkscape::ObjectSnapper::_collectPaths(Geom::Point /*p*/,
// Geom::PathVector *pv = pathvector_for_curve(root_item, curve, true, true, Geom::identity(), (*i).additional_affine);
Geom::PathVector *pv = new Geom::PathVector(curve->get_pathvector());
- (*pv) *= root_item->i2d_affine() * (*i).additional_affine * _snapmanager->getDesktop()->doc2dt(); // (_edit_transform * _i2d_transform);
+ (*pv) *= root_item->i2dt_affine() * (*i).additional_affine * _snapmanager->getDesktop()->doc2dt(); // (_edit_transform * _i2d_transform);
_paths_to_snap_to->push_back(Inkscape::SnapCandidatePath(pv, SNAPTARGET_PATH, Geom::OptRect())); // Perhaps for speed, get a reference to the Geom::pathvector, and store the transformation besides it.
curve->unref();
diff --git a/src/selcue.cpp b/src/selcue.cpp
index 171178c41..c647c1f96 100644
--- a/src/selcue.cpp
+++ b/src/selcue.cpp
@@ -191,7 +191,7 @@ void Inkscape::SelCue::_newTextBaselines()
NULL);
sp_canvas_item_show(baseline_point);
- SP_CTRL(baseline_point)->moveto((*pt) * item->i2d_affine());
+ SP_CTRL(baseline_point)->moveto((*pt) * item->i2dt_affine());
sp_canvas_item_move_to_z(baseline_point, 0);
}
}
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 9b88077e7..df3eaa388 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -1399,7 +1399,7 @@ void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Affine cons
item->readAttr( "transform" );
// calculate the matrix we need to apply to the clone to cancel its induced transform from its original
- Geom::Affine parent2dt = SP_ITEM(item->parent)->i2d_affine();
+ Geom::Affine parent2dt = SP_ITEM(item->parent)->i2dt_affine();
Geom::Affine t = parent2dt * affine * parent2dt.inverse();
Geom::Affine t_inv = t.inverse();
Geom::Affine result = t_inv * item->transform * t;
@@ -1442,7 +1442,7 @@ void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Affine cons
} else {
if (set_i2d) {
- item->set_i2d_affine(item->i2d_affine() * (Geom::Affine)affine);
+ item->set_i2d_affine(item->i2dt_affine() * (Geom::Affine)affine);
}
item->doWriteTransform(item->getRepr(), item->transform, NULL, compensate);
}
@@ -2248,8 +2248,8 @@ sp_select_clone_original(SPDesktop *desktop)
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
bool highlight = prefs->getBool("/options/highlightoriginal/value");
if (highlight) {
- Geom::OptRect a = item->getBounds(item->i2d_affine());
- Geom::OptRect b = original->getBounds(original->i2d_affine());
+ Geom::OptRect a = item->getBounds(item->i2dt_affine());
+ Geom::OptRect b = original->getBounds(original->i2dt_affine());
if ( a && b ) {
// draw a flashing line between the objects
SPCurve *curve = new SPCurve();
@@ -2766,7 +2766,7 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop)
}
// Calculate the matrix that will be applied to the image so that it exactly overlaps the source objects
- Geom::Affine eek(SP_ITEM(parent_object)->i2d_affine());
+ Geom::Affine eek(SP_ITEM(parent_object)->i2dt_affine());
Geom::Affine t;
double shift_x = bbox->min()[Geom::X];
@@ -2775,7 +2775,7 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop)
shift_x = round(shift_x);
shift_y = -round(-shift_y); // this gets correct rounding despite coordinate inversion, remove the negations when the inversion is gone
}
- t = Geom::Scale(1, -1) * Geom::Translate(shift_x, shift_y) * eek.inverse();
+ t = Geom::Scale(1, -1) * Geom::Translate(shift_x, shift_y) * eek.inverse(); /// @fixme hardcoded doc2dt transform?
// Do the export
sp_export_png_file(document, filepath,
@@ -3231,7 +3231,7 @@ fit_canvas_to_drawing(SPDocument *doc, bool with_margins)
doc->ensureUpToDate();
SPItem const *const root = doc->getRoot();
- Geom::OptRect const bbox(root->getBounds(root->i2d_affine(), SPItem::RENDERING_BBOX));
+ Geom::OptRect const bbox(root->getBounds(root->i2dt_affine(), SPItem::RENDERING_BBOX));
if (bbox) {
doc->fitToRect(*bbox, with_margins);
return true;
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index f6a702ed9..bc8194d48 100644
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
@@ -267,7 +267,7 @@ void Inkscape::SelTrans::grab(Geom::Point const &p, gdouble x, gdouble y, bool s
SPItem *it = reinterpret_cast<SPItem*>(sp_object_ref(SP_ITEM(l->data), NULL));
_items.push_back(it);
_items_const.push_back(it);
- _items_affines.push_back(it->i2d_affine());
+ _items_affines.push_back(it->i2dt_affine());
_items_centers.push_back(it->getCenter()); // for content-dragging, we need to remember original centers
}
@@ -586,7 +586,7 @@ void Inkscape::SelTrans::stamp()
Geom::Affine const *new_affine;
if (_show == SHOW_OUTLINE) {
- Geom::Affine const i2d(original_item->i2d_affine());
+ Geom::Affine const i2d(original_item->i2dt_affine());
Geom::Affine const i2dnew( i2d * _current_relative_affine );
copy_item->set_i2d_affine(i2dnew);
new_affine = &copy_item->transform;
diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp
index 7ebedb816..d2ca2c445 100644
--- a/src/sp-ellipse.cpp
+++ b/src/sp-ellipse.cpp
@@ -282,7 +282,7 @@ static void sp_genericellipse_snappoints(SPItem const *item, std::vector<Inkscap
SPGenericEllipse *ellipse = SP_GENERICELLIPSE(item);
sp_genericellipse_normalize(ellipse);
- Geom::Affine const i2d = item->i2d_affine();
+ Geom::Affine const i2dt = item->i2dt_affine();
// figure out if we have a slice, while guarding against rounding errors
bool slice = false;
@@ -308,7 +308,7 @@ static void sp_genericellipse_snappoints(SPItem const *item, std::vector<Inkscap
double angle = 0;
for (angle = 0; angle < SP_2PI; angle += M_PI_2) {
if (angle >= ellipse->start && angle <= ellipse->end) {
- pt = Geom::Point(cx + cos(angle)*rx, cy + sin(angle)*ry) * i2d;
+ pt = Geom::Point(cx + cos(angle)*rx, cy + sin(angle)*ry) * i2dt;
p.push_back(Inkscape::SnapCandidatePoint(pt, Inkscape::SNAPSOURCE_ELLIPSE_QUADRANT_POINT, Inkscape::SNAPTARGET_ELLIPSE_QUADRANT_POINT));
}
}
@@ -316,7 +316,7 @@ static void sp_genericellipse_snappoints(SPItem const *item, std::vector<Inkscap
// Add the centre, if we have a closed slice or when explicitly asked for
if ((snapprefs->getSnapToItemNode() && slice && ellipse->closed) || snapprefs->getSnapObjectMidpoints()) {
- pt = Geom::Point(cx, cy) * i2d;
+ pt = Geom::Point(cx, cy) * i2dt;
p.push_back(Inkscape::SnapCandidatePoint(pt, Inkscape::SNAPSOURCE_OBJECT_MIDPOINT, Inkscape::SNAPTARGET_OBJECT_MIDPOINT));
}
@@ -324,12 +324,12 @@ static void sp_genericellipse_snappoints(SPItem const *item, std::vector<Inkscap
if (snapprefs->getSnapToItemNode() && slice) {
// Add the start point, if it's not coincident with a quadrant point
if (fmod(ellipse->start, M_PI_2) != 0.0 ) {
- pt = Geom::Point(cx + cos(ellipse->start)*rx, cy + sin(ellipse->start)*ry) * i2d;
+ pt = Geom::Point(cx + cos(ellipse->start)*rx, cy + sin(ellipse->start)*ry) * i2dt;
p.push_back(Inkscape::SnapCandidatePoint(pt, Inkscape::SNAPSOURCE_NODE_CUSP, Inkscape::SNAPTARGET_NODE_CUSP));
}
// Add the end point, if it's not coincident with a quadrant point
if (fmod(ellipse->end, M_PI_2) != 0.0 ) {
- pt = Geom::Point(cx + cos(ellipse->end)*rx, cy + sin(ellipse->end)*ry) * i2d;
+ pt = Geom::Point(cx + cos(ellipse->end)*rx, cy + sin(ellipse->end)*ry) * i2dt;
p.push_back(Inkscape::SnapCandidatePoint(pt, Inkscape::SNAPSOURCE_NODE_CUSP, Inkscape::SNAPTARGET_NODE_CUSP));
}
}
diff --git a/src/sp-flowtext.cpp b/src/sp-flowtext.cpp
index 694e21dbd..87266464c 100644
--- a/src/sp-flowtext.cpp
+++ b/src/sp-flowtext.cpp
@@ -371,7 +371,7 @@ sp_flowtext_print(SPItem *item, SPPrintContext *ctx)
dbox.y0 = 0.0;
dbox.x1 = item->document->getWidth();
dbox.y1 = item->document->getHeight();
- Geom::Affine const ctm (item->i2d_affine());
+ Geom::Affine const ctm (item->i2dt_affine());
group->layout.print(ctx, &pbox, &dbox, &bbox, ctm);
}
@@ -400,7 +400,7 @@ static void sp_flowtext_snappoints(SPItem const *item, std::vector<Inkscape::Sna
if (layout != NULL && layout->outputExists()) {
boost::optional<Geom::Point> pt = layout->baselineAnchorPoint();
if (pt) {
- p.push_back(Inkscape::SnapCandidatePoint((*pt) * item->i2d_affine(), Inkscape::SNAPSOURCE_TEXT_ANCHOR, Inkscape::SNAPTARGET_TEXT_ANCHOR));
+ p.push_back(Inkscape::SnapCandidatePoint((*pt) * item->i2dt_affine(), Inkscape::SNAPSOURCE_TEXT_ANCHOR, Inkscape::SNAPTARGET_TEXT_ANCHOR));
}
}
}
diff --git a/src/sp-image.cpp b/src/sp-image.cpp
index c82c6fed4..c9647c939 100644
--- a/src/sp-image.cpp
+++ b/src/sp-image.cpp
@@ -1303,7 +1303,7 @@ static void sp_image_snappoints( SPItem const *item, std::vector<Inkscape::SnapC
double const y0 = image.y.computed;
double const x1 = x0 + image.width.computed;
double const y1 = y0 + image.height.computed;
- Geom::Affine const i2d (item->i2d_affine ());
+ Geom::Affine const i2d (item->i2dt_affine ());
p.push_back(Inkscape::SnapCandidatePoint(Geom::Point(x0, y0) * i2d, Inkscape::SNAPSOURCE_CORNER, Inkscape::SNAPTARGET_CORNER));
p.push_back(Inkscape::SnapCandidatePoint(Geom::Point(x0, y1) * i2d, Inkscape::SNAPSOURCE_CORNER, Inkscape::SNAPTARGET_CORNER));
p.push_back(Inkscape::SnapCandidatePoint(Geom::Point(x1, y1) * i2d, Inkscape::SNAPSOURCE_CORNER, Inkscape::SNAPTARGET_CORNER));
diff --git a/src/sp-item-notify-moveto.cpp b/src/sp-item-notify-moveto.cpp
index 2005356bd..fd27c896a 100644
--- a/src/sp-item-notify-moveto.cpp
+++ b/src/sp-item-notify-moveto.cpp
@@ -41,7 +41,7 @@ void sp_item_notify_moveto(SPItem &item, SPGuide const &mv_g, int const snappoin
s = (position - pos0) / dot(dir, dir). */
Geom::Translate const tr( ( position - pos0 )
* ( dir / dir_lensq ) );
- item.set_i2d_affine(item.i2d_affine() * tr);
+ item.set_i2d_affine(item.i2dt_affine() * tr);
/// \todo Reget snappoints, check satisfied.
if (commit) {
diff --git a/src/sp-item-transform.cpp b/src/sp-item-transform.cpp
index 0fbce27f9..9f166e718 100644
--- a/src/sp-item-transform.cpp
+++ b/src/sp-item-transform.cpp
@@ -25,7 +25,7 @@ sp_item_rotate_rel(SPItem *item, Geom::Rotate const &rotation)
Geom::Affine affine = Geom::Affine(s).inverse() * Geom::Affine(rotation) * Geom::Affine(s);
// Rotate item.
- item->set_i2d_affine(item->i2d_affine() * (Geom::Affine)affine);
+ item->set_i2d_affine(item->i2dt_affine() * (Geom::Affine)affine);
// Use each item's own transform writer, consistent with sp_selection_apply_affine()
item->doWriteTransform(item->getRepr(), item->transform);
@@ -42,7 +42,7 @@ sp_item_scale_rel (SPItem *item, Geom::Scale const &scale)
Geom::OptRect bbox = item->getBboxDesktop();
if (bbox) {
Geom::Translate const s(bbox->midpoint()); // use getCenter?
- item->set_i2d_affine(item->i2d_affine() * s.inverse() * scale * s);
+ item->set_i2d_affine(item->i2dt_affine() * s.inverse() * scale * s);
item->doWriteTransform(item->getRepr(), item->transform);
}
}
@@ -56,7 +56,7 @@ sp_item_skew_rel (SPItem *item, double skewX, double skewY)
Geom::Affine const skew(1, skewY, skewX, 1, 0, 0);
Geom::Affine affine = Geom::Affine(s).inverse() * skew * Geom::Affine(s);
- item->set_i2d_affine(item->i2d_affine() * affine);
+ item->set_i2d_affine(item->i2dt_affine() * affine);
item->doWriteTransform(item->getRepr(), item->transform);
// Restore the center position (it's changed because the bbox center changed)
@@ -68,7 +68,7 @@ sp_item_skew_rel (SPItem *item, double skewX, double skewY)
void sp_item_move_rel(SPItem *item, Geom::Translate const &tr)
{
- item->set_i2d_affine(item->i2d_affine() * tr);
+ item->set_i2d_affine(item->i2dt_affine() * tr);
item->doWriteTransform(item->getRepr(), item->transform);
}
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 43fe2c227..905a8f2db 100644
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
@@ -272,7 +272,7 @@ void SPItem::setCenter(Geom::Point object_centre) {
// for getBounds() to work
document->ensureUpToDate();
- Geom::OptRect bbox = getBounds(i2d_affine());
+ Geom::OptRect bbox = getBounds(i2dt_affine());
if (bbox) {
transform_center_x = object_centre[Geom::X] - bbox->midpoint()[Geom::X];
if (fabs(transform_center_x) < 1e-5) // rounding error
@@ -297,7 +297,7 @@ Geom::Point SPItem::getCenter() const {
// for getBounds() to work
document->ensureUpToDate();
- Geom::OptRect bbox = getBounds(i2d_affine());
+ Geom::OptRect bbox = getBounds(i2dt_affine());
if (bbox) {
return bbox->midpoint() + Geom::Point (transform_center_x, transform_center_y);
} else {
@@ -790,11 +790,11 @@ void SPItem::invoke_bbox_full( Geom::OptRect &bbox, Geom::Affine const &transfor
}
// transform the expansions by the item's transform:
- Geom::Affine i2d(i2d_affine ());
- dx0 *= i2d.expansionX();
- dx1 *= i2d.expansionX();
- dy0 *= i2d.expansionY();
- dy1 *= i2d.expansionY();
+ Geom::Affine i2dt(i2dt_affine ());
+ dx0 *= i2dt.expansionX();
+ dx1 *= i2dt.expansionX();
+ dy0 *= i2dt.expansionY();
+ dy1 *= i2dt.expansionY();
// expand the bbox
temp_bbox.x0 += dx0;
@@ -890,13 +890,13 @@ void SPItem::getBboxDesktop(NRRect *bbox, SPItem::BBoxType type)
{
g_assert(bbox != NULL);
- invoke_bbox( bbox, i2d_affine(), TRUE, type);
+ invoke_bbox( bbox, i2dt_affine(), TRUE, type);
}
Geom::OptRect SPItem::getBboxDesktop(SPItem::BBoxType type)
{
Geom::OptRect rect = Geom::OptRect();
- invoke_bbox( rect, i2d_affine(), TRUE, type);
+ invoke_bbox( rect, i2dt_affine(), TRUE, type);
return rect;
}
@@ -907,7 +907,7 @@ void SPItem::sp_item_private_snappoints(SPItem const *item, std::vector<Inkscape
* We don't know what shape we could be dealing with here, so we'll just
* return the corners of the bounding box */
- Geom::OptRect bbox = item->getBounds(item->i2d_affine());
+ Geom::OptRect bbox = item->getBounds(item->i2dt_affine());
if (bbox) {
Geom::Point p1, p2;
@@ -953,7 +953,7 @@ void SPItem::getSnappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscap
for (std::vector<Inkscape::SnapCandidatePoint>::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
- Geom::Point pt = desktop->dt2doc((*p_orig).getPoint()) * i2d_affine();
+ Geom::Point pt = desktop->dt2doc((*p_orig).getPoint()) * i2dt_affine();
p.push_back(Inkscape::SnapCandidatePoint(pt, (*p_orig).getSourceType(), (*p_orig).getTargetType()));
}
}
@@ -1465,11 +1465,13 @@ Geom::Affine SPItem::i2doc_affine() const
/**
* Returns the transformation from item to desktop coords
*/
-Geom::Affine SPItem::i2d_affine() const
+Geom::Affine SPItem::i2dt_affine() const
{
- Geom::Affine const ret( i2doc_affine()
- * Geom::Scale(1, -1)
- * Geom::Translate(0, document->getHeight()) );
+// Geom::Affine const ret( i2doc_affine()
+// * Geom::Scale(1, -1)
+// * Geom::Translate(0, document->getHeight()) );
+ SPDesktop const *desktop = inkscape_active_desktop();
+ Geom::Affine const ret( i2doc_affine() * desktop->doc2dt() );
return ret;
}
@@ -1477,10 +1479,10 @@ void SPItem::set_i2d_affine(Geom::Affine const &i2dt)
{
Geom::Affine dt2p; /* desktop to item parent transform */
if (parent) {
- dt2p = static_cast<SPItem *>(parent)->i2d_affine().inverse();
+ dt2p = static_cast<SPItem *>(parent)->i2dt_affine().inverse();
} else {
dt2p = ( Geom::Translate(0, -document->getHeight())
- * Geom::Scale(1, -1) );
+ * Geom::Scale(1, -1) ); /// @fixme hardcoded doc2dt transform?
}
Geom::Affine const i2p( i2dt * dt2p );
@@ -1494,7 +1496,7 @@ void SPItem::set_i2d_affine(Geom::Affine const &i2dt)
Geom::Affine SPItem::dt2i_affine() const
{
/* fixme: Implement the right way (Lauris) */
- return i2d_affine().inverse();
+ return i2dt_affine().inverse();
}
/* Item views */
diff --git a/src/sp-item.h b/src/sp-item.h
index 7c3eb87d9..0065a9c0e 100644
--- a/src/sp-item.h
+++ b/src/sp-item.h
@@ -201,7 +201,7 @@ public:
void getBboxDesktop(NRRect *bbox, SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX) __attribute__ ((deprecated));
Geom::OptRect getBboxDesktop(SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX);
Geom::Affine i2doc_affine() const;
- Geom::Affine i2d_affine() const;
+ Geom::Affine i2dt_affine() const;
void set_i2d_affine(Geom::Affine const &transform);
Geom::Affine dt2i_affine() const;
void convert_to_guides();
diff --git a/src/sp-line.cpp b/src/sp-line.cpp
index b21122566..0f467b68e 100644
--- a/src/sp-line.cpp
+++ b/src/sp-line.cpp
@@ -179,10 +179,10 @@ void SPLine::convertToGuides(SPItem *item)
SPLine *line = SP_LINE(item);
Geom::Point points[2];
- Geom::Affine const i2d(item->i2d_affine());
+ Geom::Affine const i2dt(item->i2dt_affine());
- points[0] = Geom::Point(line->x1.computed, line->y1.computed)*i2d;
- points[1] = Geom::Point(line->x2.computed, line->y2.computed)*i2d;
+ points[0] = Geom::Point(line->x1.computed, line->y1.computed)*i2dt;
+ points[1] = Geom::Point(line->x2.computed, line->y2.computed)*i2dt;
SPGuide::createSPGuide(inkscape_active_desktop(), points[0], points[1]);
}
diff --git a/src/sp-path.cpp b/src/sp-path.cpp
index 6191d114f..d9fb006f2 100644
--- a/src/sp-path.cpp
+++ b/src/sp-path.cpp
@@ -169,7 +169,7 @@ sp_path_convert_to_guides(SPItem *item)
std::list<std::pair<Geom::Point, Geom::Point> > pts;
- Geom::Affine const i2d(path->i2d_affine());
+ Geom::Affine const i2dt(path->i2dt_affine());
Geom::PathVector const & pv = curve->get_pathvector();
for(Geom::PathVector::const_iterator pit = pv.begin(); pit != pv.end(); ++pit) {
@@ -177,7 +177,7 @@ sp_path_convert_to_guides(SPItem *item)
// only add curves for straight line segments
if( is_straight_curve(*cit) )
{
- pts.push_back(std::make_pair(cit->initialPoint() * i2d, cit->finalPoint() * i2d));
+ pts.push_back(std::make_pair(cit->initialPoint() * i2dt, cit->finalPoint() * i2dt));
}
}
}
diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp
index 7cc9c7f29..ec83a47e9 100644
--- a/src/sp-rect.cpp
+++ b/src/sp-rect.cpp
@@ -573,12 +573,12 @@ static void sp_rect_snappoints(SPItem const *item, std::vector<Inkscape::SnapCan
SPRect *rect = SP_RECT(item);
- Geom::Affine const i2d (item->i2d_affine ());
+ Geom::Affine const i2dt (item->i2dt_affine ());
- Geom::Point p0 = Geom::Point(rect->x.computed, rect->y.computed) * i2d;
- Geom::Point p1 = Geom::Point(rect->x.computed, rect->y.computed + rect->height.computed) * i2d;
- Geom::Point p2 = Geom::Point(rect->x.computed + rect->width.computed, rect->y.computed + rect->height.computed) * i2d;
- Geom::Point p3 = Geom::Point(rect->x.computed + rect->width.computed, rect->y.computed) * i2d;
+ Geom::Point p0 = Geom::Point(rect->x.computed, rect->y.computed) * i2dt;
+ Geom::Point p1 = Geom::Point(rect->x.computed, rect->y.computed + rect->height.computed) * i2dt;
+ Geom::Point p2 = Geom::Point(rect->x.computed + rect->width.computed, rect->y.computed + rect->height.computed) * i2dt;
+ Geom::Point p3 = Geom::Point(rect->x.computed + rect->width.computed, rect->y.computed) * i2dt;
if (snapprefs->getSnapToItemNode()) {
p.push_back(Inkscape::SnapCandidatePoint(p0, Inkscape::SNAPSOURCE_CORNER, Inkscape::SNAPTARGET_CORNER));
@@ -612,12 +612,12 @@ sp_rect_convert_to_guides(SPItem *item) {
std::list<std::pair<Geom::Point, Geom::Point> > pts;
- Geom::Affine const i2d(rect->i2d_affine());
+ Geom::Affine const i2dt(rect->i2dt_affine());
- Geom::Point A1(Geom::Point(rect->x.computed, rect->y.computed) * i2d);
- Geom::Point A2(Geom::Point(rect->x.computed, rect->y.computed + rect->height.computed) * i2d);
- Geom::Point A3(Geom::Point(rect->x.computed + rect->width.computed, rect->y.computed + rect->height.computed) * i2d);
- Geom::Point A4(Geom::Point(rect->x.computed + rect->width.computed, rect->y.computed) * i2d);
+ Geom::Point A1(Geom::Point(rect->x.computed, rect->y.computed) * i2dt);
+ Geom::Point A2(Geom::Point(rect->x.computed, rect->y.computed + rect->height.computed) * i2dt);
+ Geom::Point A3(Geom::Point(rect->x.computed + rect->width.computed, rect->y.computed + rect->height.computed) * i2dt);
+ Geom::Point A4(Geom::Point(rect->x.computed + rect->width.computed, rect->y.computed) * i2dt);
pts.push_back(std::make_pair(A1, A2));
pts.push_back(std::make_pair(A2, A3));
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp
index bbfa98598..beec860be 100644
--- a/src/sp-shape.cpp
+++ b/src/sp-shape.cpp
@@ -763,16 +763,16 @@ sp_shape_print (SPItem *item, SPPrintContext *ctx)
dbox.x1 = item->document->getWidth();
dbox.y1 = item->document->getHeight();
item->getBboxDesktop (&bbox);
- Geom::Affine const i2d(item->i2d_affine());
+ Geom::Affine const i2dt(item->i2dt_affine());
SPStyle* style = item->style;
if (!style->fill.isNone()) {
- sp_print_fill (ctx, pathv, &i2d, style, &pbox, &dbox, &bbox);
+ sp_print_fill (ctx, pathv, &i2dt, style, &pbox, &dbox, &bbox);
}
if (!style->stroke.isNone()) {
- sp_print_stroke (ctx, pathv, &i2d, style, &pbox, &dbox, &bbox);
+ sp_print_stroke (ctx, pathv, &i2dt, style, &pbox, &dbox, &bbox);
}
/** \todo make code prettier */
@@ -1197,10 +1197,10 @@ void SPShape::sp_shape_snappoints(SPItem const *item, std::vector<Inkscape::Snap
if (pathv.empty())
return;
- Geom::Affine const i2d (item->i2d_affine ());
+ Geom::Affine const i2dt (item->i2dt_affine ());
if (snapprefs->getSnapObjectMidpoints()) {
- Geom::OptRect bbox = item->getBounds(item->i2d_affine());
+ Geom::OptRect bbox = item->getBounds(i2dt);
if (bbox) {
p.push_back(Inkscape::SnapCandidatePoint(bbox->midpoint(), Inkscape::SNAPSOURCE_OBJECT_MIDPOINT, Inkscape::SNAPTARGET_OBJECT_MIDPOINT));
}
@@ -1209,7 +1209,7 @@ void SPShape::sp_shape_snappoints(SPItem const *item, std::vector<Inkscape::Snap
for(Geom::PathVector::const_iterator path_it = pathv.begin(); path_it != pathv.end(); ++path_it) {
if (snapprefs->getSnapToItemNode()) {
// Add the first point of the path
- p.push_back(Inkscape::SnapCandidatePoint(path_it->initialPoint() * i2d, Inkscape::SNAPSOURCE_NODE_CUSP, Inkscape::SNAPTARGET_NODE_CUSP));
+ p.push_back(Inkscape::SnapCandidatePoint(path_it->initialPoint() * i2dt, Inkscape::SNAPSOURCE_NODE_CUSP, Inkscape::SNAPTARGET_NODE_CUSP));
}
Geom::Path::const_iterator curve_it1 = path_it->begin(); // incoming curve
@@ -1219,7 +1219,7 @@ void SPShape::sp_shape_snappoints(SPItem const *item, std::vector<Inkscape::Snap
// For each path: consider midpoints of line segments for snapping
if (snapprefs->getSnapLineMidpoints()) { // only do this when we're snapping nodes (enforces strict snapping)
if (Geom::LineSegment const* line_segment = dynamic_cast<Geom::LineSegment const*>(&(*curve_it1))) {
- p.push_back(Inkscape::SnapCandidatePoint(Geom::middle_point(*line_segment) * i2d, Inkscape::SNAPSOURCE_LINE_MIDPOINT, Inkscape::SNAPTARGET_LINE_MIDPOINT));
+ p.push_back(Inkscape::SnapCandidatePoint(Geom::middle_point(*line_segment) * i2dt, Inkscape::SNAPSOURCE_LINE_MIDPOINT, Inkscape::SNAPTARGET_LINE_MIDPOINT));
}
}
@@ -1227,7 +1227,7 @@ void SPShape::sp_shape_snappoints(SPItem const *item, std::vector<Inkscape::Snap
if (snapprefs->getSnapToItemNode() && !path_it->closed()) {
// Add the last point of the path, but only for open paths
// (for closed paths the first and last point will coincide)
- p.push_back(Inkscape::SnapCandidatePoint((*curve_it1).finalPoint() * i2d, Inkscape::SNAPSOURCE_NODE_CUSP, Inkscape::SNAPTARGET_NODE_CUSP));
+ p.push_back(Inkscape::SnapCandidatePoint((*curve_it1).finalPoint() * i2dt, Inkscape::SNAPSOURCE_NODE_CUSP, Inkscape::SNAPTARGET_NODE_CUSP));
}
} else {
/* Test whether to add the node between curve_it1 and curve_it2.
@@ -1256,7 +1256,7 @@ void SPShape::sp_shape_snappoints(SPItem const *item, std::vector<Inkscape::Snap
stt = Inkscape::SNAPTARGET_UNDEFINED;
break;
}
- p.push_back(Inkscape::SnapCandidatePoint(curve_it1->finalPoint() * i2d, sst, stt));
+ p.push_back(Inkscape::SnapCandidatePoint(curve_it1->finalPoint() * i2dt, sst, stt));
}
}
@@ -1273,7 +1273,7 @@ void SPShape::sp_shape_snappoints(SPItem const *item, std::vector<Inkscape::Snap
if (cs.size() > 0) { // There might be multiple intersections...
for (Geom::Crossings::const_iterator i = cs.begin(); i != cs.end(); i++) {
Geom::Point p_ix = (*path_it).pointAt((*i).ta);
- p.push_back(Inkscape::SnapCandidatePoint(p_ix * i2d, Inkscape::SNAPSOURCE_PATH_INTERSECTION, Inkscape::SNAPTARGET_PATH_INTERSECTION));
+ p.push_back(Inkscape::SnapCandidatePoint(p_ix * i2dt, Inkscape::SNAPSOURCE_PATH_INTERSECTION, Inkscape::SNAPTARGET_PATH_INTERSECTION));
}
}
} catch (Geom::RangeError &e) {
diff --git a/src/sp-spiral.cpp b/src/sp-spiral.cpp
index a772e057d..3ba05adc6 100644
--- a/src/sp-spiral.cpp
+++ b/src/sp-spiral.cpp
@@ -534,9 +534,9 @@ static void sp_spiral_snappoints(SPItem const *item, std::vector<Inkscape::SnapC
}
if (snapprefs->getSnapObjectMidpoints()) {
- Geom::Affine const i2d (item->i2d_affine ());
+ Geom::Affine const i2dt (item->i2dt_affine ());
SPSpiral *spiral = SP_SPIRAL(item);
- p.push_back(Inkscape::SnapCandidatePoint(Geom::Point(spiral->cx, spiral->cy) * i2d, Inkscape::SNAPSOURCE_OBJECT_MIDPOINT, Inkscape::SNAPTARGET_OBJECT_MIDPOINT));
+ p.push_back(Inkscape::SnapCandidatePoint(Geom::Point(spiral->cx, spiral->cy) * i2dt, Inkscape::SNAPSOURCE_OBJECT_MIDPOINT, Inkscape::SNAPTARGET_OBJECT_MIDPOINT));
// This point is the start-point of the spiral, which is also returned when _snap_to_itemnode has been set
// in the object snapper. In that case we will get a duplicate!
}
diff --git a/src/sp-star.cpp b/src/sp-star.cpp
index 17ddf7279..c7c2c54ad 100644
--- a/src/sp-star.cpp
+++ b/src/sp-star.cpp
@@ -562,8 +562,8 @@ static void sp_star_snappoints(SPItem const *item, std::vector<Inkscape::SnapCan
}
if (snapprefs->getSnapObjectMidpoints()) {
- Geom::Affine const i2d (item->i2d_affine ());
- p.push_back(Inkscape::SnapCandidatePoint(SP_STAR(item)->center * i2d,Inkscape::SNAPSOURCE_OBJECT_MIDPOINT, Inkscape::SNAPTARGET_OBJECT_MIDPOINT));
+ Geom::Affine const i2dt (item->i2dt_affine ());
+ p.push_back(Inkscape::SnapCandidatePoint(SP_STAR(item)->center * i2dt,Inkscape::SNAPSOURCE_OBJECT_MIDPOINT, Inkscape::SNAPTARGET_OBJECT_MIDPOINT));
}
}
diff --git a/src/sp-text.cpp b/src/sp-text.cpp
index f7ba7592b..89ca4ace4 100644
--- a/src/sp-text.cpp
+++ b/src/sp-text.cpp
@@ -450,7 +450,7 @@ static void sp_text_snappoints(SPItem const *item, std::vector<Inkscape::SnapCan
if (layout != NULL && layout->outputExists()) {
boost::optional<Geom::Point> pt = layout->baselineAnchorPoint();
if (pt) {
- p.push_back(Inkscape::SnapCandidatePoint((*pt) * item->i2d_affine(), Inkscape::SNAPSOURCE_TEXT_ANCHOR, Inkscape::SNAPTARGET_TEXT_ANCHOR));
+ p.push_back(Inkscape::SnapCandidatePoint((*pt) * item->i2dt_affine(), Inkscape::SNAPSOURCE_TEXT_ANCHOR, Inkscape::SNAPTARGET_TEXT_ANCHOR));
}
}
}
@@ -517,7 +517,7 @@ sp_text_print (SPItem *item, SPPrintContext *ctx)
dbox.y0 = 0.0;
dbox.x1 = item->document->getWidth();
dbox.y1 = item->document->getHeight();
- Geom::Affine const ctm (item->i2d_affine());
+ Geom::Affine const ctm (item->i2dt_affine());
group->layout.print(ctx,&pbox,&dbox,&bbox,ctm);
}
diff --git a/src/splivarot.cpp b/src/splivarot.cpp
index 3d3027639..d3d6c3db7 100644
--- a/src/splivarot.cpp
+++ b/src/splivarot.cpp
@@ -1963,7 +1963,7 @@ sp_selected_path_simplify_items(SPDesktop *desktop,
continue;
if (simplifyIndividualPaths) {
- Geom::OptRect itemBbox = item->getBounds(item->i2d_affine());
+ Geom::OptRect itemBbox = item->getBounds(item->i2dt_affine());
if (itemBbox) {
simplifySize = L2(itemBbox->dimensions());
} else {
diff --git a/src/spray-context.cpp b/src/spray-context.cpp
index 8b0454893..33fffb01f 100644
--- a/src/spray-context.cpp
+++ b/src/spray-context.cpp
@@ -137,7 +137,7 @@ void sp_spray_rotate_rel(Geom::Point c, SPDesktop */*desktop*/, SPItem *item, Ge
Geom::Translate const s(c);
Geom::Affine affine = Geom::Affine(s).inverse() * Geom::Affine(rotation) * Geom::Affine(s);
// Rotate item.
- item->set_i2d_affine(item->i2d_affine() * (Geom::Affine)affine);
+ item->set_i2d_affine(item->i2dt_affine() * (Geom::Affine)affine);
// Use each item's own transform writer, consistent with sp_selection_apply_affine()
item->doWriteTransform(item->getRepr(), item->transform);
// Restore the center position (it's changed because the bbox center changed)
@@ -151,7 +151,7 @@ void sp_spray_rotate_rel(Geom::Point c, SPDesktop */*desktop*/, SPItem *item, Ge
void sp_spray_scale_rel(Geom::Point c, SPDesktop */*desktop*/, SPItem *item, Geom::Scale const &scale)
{
Geom::Translate const s(c);
- item->set_i2d_affine(item->i2d_affine() * s.inverse() * scale * s);
+ item->set_i2d_affine(item->i2dt_affine() * s.inverse() * scale * s);
item->doWriteTransform(item->getRepr(), item->transform);
}
diff --git a/src/text-context.cpp b/src/text-context.cpp
index 9edf96b26..1468984a1 100644
--- a/src/text-context.cpp
+++ b/src/text-context.cpp
@@ -1593,8 +1593,8 @@ sp_text_context_update_cursor(SPTextContext *tc, bool scroll_to_see)
if (tc->text) {
Geom::Point p0, p1;
sp_te_get_cursor_coords(tc->text, tc->text_sel_end, p0, p1);
- Geom::Point const d0 = p0 * tc->text->i2d_affine();
- Geom::Point const d1 = p1 * tc->text->i2d_affine();
+ Geom::Point const d0 = p0 * tc->text->i2dt_affine();
+ Geom::Point const d1 = p1 * tc->text->i2dt_affine();
// scroll to show cursor
if (scroll_to_see) {
@@ -1675,7 +1675,7 @@ static void sp_text_context_update_text_selection(SPTextContext *tc)
std::vector<Geom::Point> quads;
if (tc->text != NULL)
- quads = sp_te_create_selection_quads(tc->text, tc->text_sel_start, tc->text_sel_end, (tc->text)->i2d_affine());
+ quads = sp_te_create_selection_quads(tc->text, tc->text_sel_start, tc->text_sel_end, (tc->text)->i2dt_affine());
for (unsigned i = 0 ; i < quads.size() ; i += 4) {
SPCanvasItem *quad_canvasitem;
quad_canvasitem = sp_canvas_item_new(sp_desktop_controls(tc->desktop), SP_TYPE_CTRLQUADR, NULL);
diff --git a/src/text-editing.cpp b/src/text-editing.cpp
index b3f76817c..7b032065b 100644
--- a/src/text-editing.cpp
+++ b/src/text-editing.cpp
@@ -87,7 +87,7 @@ bool sp_te_input_is_empty(SPObject const *item)
Inkscape::Text::Layout::iterator
sp_te_get_position_by_coords (SPItem const *item, Geom::Point const &i_p)
{
- Geom::Affine im (item->i2d_affine ());
+ Geom::Affine im (item->i2dt_affine ());
im = im.inverse();
Geom::Point p = i_p * im;
diff --git a/src/tweak-context.cpp b/src/tweak-context.cpp
index eb4e28bd4..83598d8da 100644
--- a/src/tweak-context.cpp
+++ b/src/tweak-context.cpp
@@ -983,7 +983,7 @@ sp_tweak_color_recursive (guint mode, SPItem *item, SPItem *item_at_point,
}
double blur_now = 0;
- Geom::Affine i2d = item->i2d_affine ();
+ Geom::Affine i2dt = item->i2dt_affine ();
if (style->filter.set && style->getFilter()) {
//cycle through filter primitives
SPObject *primitive_obj = style->getFilter()->children;
@@ -994,7 +994,7 @@ sp_tweak_color_recursive (guint mode, SPItem *item, SPItem *item_at_point,
if(SP_IS_GAUSSIANBLUR(primitive)) {
SPGaussianBlur * spblur = SP_GAUSSIANBLUR(primitive);
float num = spblur->stdDeviation.getNumber();
- blur_now += num * i2d.descrim(); // sum all blurs in the filter
+ blur_now += num * i2dt.descrim(); // sum all blurs in the filter
}
}
primitive_obj = primitive_obj->next;
diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp
index 904432d65..8728e2ef4 100644
--- a/src/ui/dialog/align-and-distribute.cpp
+++ b/src/ui/dialog/align-and-distribute.cpp
@@ -806,7 +806,7 @@ private :
Inkscape::Text::Layout const *layout = te_get_layout(*it);
boost::optional<Geom::Point> pt = layout->baselineAnchorPoint();
if (pt) {
- Geom::Point base = *pt * (*it)->i2d_affine();
+ Geom::Point base = *pt * (*it)->i2dt_affine();
if (base[Geom::X] < b_min[Geom::X]) b_min[Geom::X] = base[Geom::X];
if (base[Geom::Y] < b_min[Geom::Y]) b_min[Geom::Y] = base[Geom::Y];
if (base[Geom::X] > b_max[Geom::X]) b_max[Geom::X] = base[Geom::X];
@@ -849,7 +849,7 @@ private :
Inkscape::Text::Layout const *layout = te_get_layout(*it);
boost::optional<Geom::Point> pt = layout->baselineAnchorPoint();
if (pt) {
- Geom::Point base = *pt * (*it)->i2d_affine();
+ Geom::Point base = *pt * (*it)->i2dt_affine();
Geom::Point t(0.0, 0.0);
t[_orientation] = b_min[_orientation] - base[_orientation];
sp_item_move_rel(*it, Geom::Translate(t));
diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp
index e83aeccad..bb800f9ca 100644
--- a/src/ui/dialog/filedialogimpl-win32.cpp
+++ b/src/ui/dialog/filedialogimpl-win32.cpp
@@ -995,7 +995,7 @@ bool FileOpenDialogImplWin32::set_svg_preview()
Geom::OptRect maybeArea(area);
svgDoc->ensureUpToDate();
svgDoc->getRoot()->invoke_bbox( maybeArea,
- svgDoc->getRoot()->i2d_affine(), TRUE);
+ svgDoc->getRoot()->i2dt_affine(), TRUE);
NRArena *const arena = NRArena::create();
diff --git a/src/ui/dialog/tile.cpp b/src/ui/dialog/tile.cpp
index 7c7413ce5..68ad9393c 100644
--- a/src/ui/dialog/tile.cpp
+++ b/src/ui/dialog/tile.cpp
@@ -337,7 +337,7 @@ g_print("\n row = %f col = %f selection x= %f selection y = %f", total_row_h
// signs are inverted between x and y due to y inversion
Geom::Point move = Geom::Point(new_x - min[Geom::X], min[Geom::Y] - new_y);
Geom::Affine const affine = Geom::Affine(Geom::Translate(move));
- item->set_i2d_affine(item->i2d_affine() * affine);
+ item->set_i2d_affine(item->i2dt_affine() * affine);
item->doWriteTransform(repr, item->transform, NULL);
SP_OBJECT (current_row->data)->updateRepr();
cnt +=1;
diff --git a/src/ui/tool/node-tool.cpp b/src/ui/tool/node-tool.cpp
index f83f8c473..6385fce0a 100644
--- a/src/ui/tool/node-tool.cpp
+++ b/src/ui/tool/node-tool.cpp
@@ -485,7 +485,7 @@ gint ink_node_tool_root_handler(SPEventContext *event_context, GdkEvent *event)
nt->flashed_item = over_item;
SPCurve *c = SP_SHAPE(over_item)->getCurveBeforeLPE();
if (!c) break; // break out when curve doesn't exist
- c->transform(over_item->i2d_affine());
+ c->transform(over_item->i2dt_affine());
SPCanvasItem *flash = sp_canvas_bpath_new(sp_desktop_tempgroup(desktop), c);
sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(flash),
prefs->getInt("/tools/nodes/highlight_color", 0xff0000ff), 1.0,
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp
index 9afcf6323..1310219a1 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -120,7 +120,7 @@ PathManipulator::PathManipulator(MultiPathManipulator &mpm, SPPath *path,
, _lpe_key(lpe_key)
{
if (_lpe_key.empty()) {
- _i2d_transform = path->i2d_affine();
+ _i2d_transform = path->i2dt_affine();
} else {
_i2d_transform = Geom::identity();
}
@@ -976,7 +976,7 @@ void PathManipulator::_externalChange(unsigned type)
} break;
case PATH_CHANGE_TRANSFORM: {
Geom::Affine i2d_change = _d2i_transform;
- _i2d_transform = _path->i2d_affine();
+ _i2d_transform = _path->i2dt_affine();
_d2i_transform = _i2d_transform.inverse();
i2d_change *= _i2d_transform;
for (SubpathList::iterator i = _subpaths.begin(); i != _subpaths.end(); ++i) {
diff --git a/src/unclump.cpp b/src/unclump.cpp
index baeeaff76..e570e8fa7 100644
--- a/src/unclump.cpp
+++ b/src/unclump.cpp
@@ -34,7 +34,7 @@ unclump_center (SPItem *item)
return i->second;
}
- Geom::OptRect r = item->getBounds(item->i2d_affine());
+ Geom::OptRect r = item->getBounds(item->i2dt_affine());
if (r) {
Geom::Point const c = r->midpoint();
c_cache[item->getId()] = c;
@@ -53,7 +53,7 @@ unclump_wh (SPItem *item)
if ( i != wh_cache.end() ) {
wh = i->second;
} else {
- Geom::OptRect r = item->getBounds(item->i2d_affine());
+ Geom::OptRect r = item->getBounds(item->i2dt_affine());
if (r) {
wh = r->dimensions();
wh_cache[item->getId()] = wh;
@@ -297,7 +297,7 @@ unclump_push (SPItem *from, SPItem *what, double dist)
//g_print ("push %s at %g,%g from %g,%g by %g,%g, dist %g\n", what->getId(), it[Geom::X],it[Geom::Y], p[Geom::X],p[Geom::Y], by[Geom::X],by[Geom::Y], dist);
- what->set_i2d_affine(what->i2d_affine() * move);
+ what->set_i2d_affine(what->i2dt_affine() * move);
what->doWriteTransform(what->getRepr(), what->transform, NULL);
}
@@ -320,7 +320,7 @@ unclump_pull (SPItem *to, SPItem *what, double dist)
//g_print ("pull %s at %g,%g to %g,%g by %g,%g, dist %g\n", what->getId(), it[Geom::X],it[Geom::Y], p[Geom::X],p[Geom::Y], by[Geom::X],by[Geom::Y], dist);
- what->set_i2d_affine(what->i2d_affine() * move);
+ what->set_i2d_affine(what->i2dt_affine() * move);
what->doWriteTransform(what->getRepr(), what->transform, NULL);
}