summaryrefslogtreecommitdiffstats
path: root/src/object/sp-tspan.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2018-05-31 11:59:40 +0000
committerTavmjong Bah <tavmjong@free.fr>2018-05-31 11:59:40 +0000
commitad8c369ad3bbf157360ae4c0c479ca3cdb016cf5 (patch)
tree58c03547e6f2ea21e80b2b4c2310cab41a85ac2e /src/object/sp-tspan.cpp
parentMore boilerplate for 'textPath' 'side' attribute. (diff)
downloadinkscape-ad8c369ad3bbf157360ae4c0c479ca3cdb016cf5.tar.gz
inkscape-ad8c369ad3bbf157360ae4c0c479ca3cdb016cf5.zip
Implement rendering for 'textPath' 'side' attribute. No GUI.
Diffstat (limited to 'src/object/sp-tspan.cpp')
-rw-r--r--src/object/sp-tspan.cpp33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/object/sp-tspan.cpp b/src/object/sp-tspan.cpp
index 5a604e4a2..9aee85d39 100644
--- a/src/object/sp-tspan.cpp
+++ b/src/object/sp-tspan.cpp
@@ -31,16 +31,22 @@
#include <string>
#include <glibmm/i18n.h>
-#include <livarot/Path.h>
-#include "svg/stringstream.h"
#include "attributes.h"
-#include "sp-use-reference.h"
-#include "sp-tspan.h"
-#include "sp-tref.h"
-#include "sp-textpath.h"
+#include "document.h"
#include "text-editing.h"
+
+#include "sp-textpath.h"
+#include "sp-tref.h"
+#include "sp-tspan.h"
+#include "sp-use-reference.h"
#include "style.h"
-#include "document.h"
+
+#include "display/curve.h"
+
+#include "livarot/Path.h"
+
+#include "svg/stringstream.h"
+
/*#####################################################
# SPTSPAN
@@ -353,15 +359,24 @@ void refresh_textpath_source(SPTextPath* tp)
tp->sourcePath->refresh_source();
tp->sourcePath->sourceDirty=false;
- // finalisons
if ( tp->sourcePath->originalPath ) {
if (tp->originalPath) {
delete tp->originalPath;
}
+ SPCurve* curve_copy;
+ if (tp->side == SP_TEXT_PATH_SIDE_LEFT) {
+ curve_copy = tp->sourcePath->originalPath->copy();
+ } else {
+ curve_copy = tp->sourcePath->originalPath->create_reverse();
+ }
+
+ SPItem *item = SP_ITEM(tp->sourcePath->sourceObject);
tp->originalPath = new Path;
- tp->originalPath->Copy(tp->sourcePath->originalPath);
+ tp->originalPath->LoadPathVector(curve_copy->get_pathvector(), item->transform, true);
tp->originalPath->ConvertWithBackData(0.01);
+
+ curve_copy->unref();
}
}