Code

From trunk
[inkscape.git] / src / sp-text.cpp
index 754cc24f91e2e19f7d73a7bdb26cdbca8c3fa156..eae9dd08877684e503b2c048699db969da626078 100644 (file)
@@ -25,6 +25,7 @@
 # include "config.h"
 #endif
 
+#include <2geom/matrix.h>
 #include <libnr/nr-matrix-fns.h>
 #include <libnrtype/FontFactory.h>
 #include <libnrtype/font-instance.h>
@@ -73,8 +74,8 @@ static void sp_text_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const &t
 static NRArenaItem *sp_text_show (SPItem *item, NRArena *arena, unsigned key, unsigned flags);
 static void sp_text_hide (SPItem *item, unsigned key);
 static char *sp_text_description (SPItem *item);
-static void sp_text_snappoints(SPItem const *item, SnapPointsIter p);
-static NR::Matrix sp_text_set_transform(SPItem *item, NR::Matrix const &xform);
+static void sp_text_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const *snapprefs);
+static Geom::Matrix sp_text_set_transform(SPItem *item, Geom::Matrix const &xform);
 static void sp_text_print (SPItem *item, SPPrintContext *gpc);
 
 static SPItemClass *text_parent_class;
@@ -427,7 +428,7 @@ sp_text_description(SPItem *item)
     return ret;
 }
 
-static void sp_text_snappoints(SPItem const *item, SnapPointsIter p)
+static void sp_text_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const *snapprefs)
 {
     // the baseline anchor of the first char
     Inkscape::Text::Layout const *layout = te_get_layout((SPItem *) item);
@@ -436,8 +437,8 @@ static void sp_text_snappoints(SPItem const *item, SnapPointsIter p)
     }
 }
 
-static NR::Matrix
-sp_text_set_transform (SPItem *item, NR::Matrix const &xform)
+static Geom::Matrix
+sp_text_set_transform (SPItem *item, Geom::Matrix const &xform)
 {
     SPText *text = SP_TEXT(item);
 
@@ -454,12 +455,12 @@ sp_text_set_transform (SPItem *item, NR::Matrix const &xform)
 // (e.g. it broke stroke width on copy/pasting of style from horizontally stretched to vertically
 // stretched shape). Using fontsize_expansion only here broke setting the style via font
 // dialog. This needs to be investigated further.
-    double const ex = NR::expansion(xform);
+    double const ex = xform.descrim();
     if (ex == 0) {
         return xform;
     }
 
-    NR::Matrix ret(NR::transform(xform));
+    Geom::Matrix ret(Geom::Matrix(xform).without_translation());
     ret[0] /= ex;
     ret[1] /= ex;
     ret[2] /= ex;