From 6bb0828320c9d79a07c544947c4d50c747a82e8d Mon Sep 17 00:00:00 2001 From: Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> Date: Tue, 21 May 2019 14:15:00 +1000 Subject: [PATCH 1/2] Add check for empty text on path Fixes https://gitlab.com/inkscape/inkscape/issues/261 --- src/libnrtype/Layout-TNG-Output.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libnrtype/Layout-TNG-Output.cpp b/src/libnrtype/Layout-TNG-Output.cpp index a3c11133b0..812abba58c 100644 --- a/src/libnrtype/Layout-TNG-Output.cpp +++ b/src/libnrtype/Layout-TNG-Output.cpp @@ -667,7 +667,8 @@ void Layout::fitToPathAlign(SVGLength const &startOffset, Path const &path) offset = startOffset.computed; } - switch (_paragraphs.front().alignment) { + Alignment alignment = _paragraphs.empty() ? LEFT : _paragraphs.front().alignment; + switch (alignment) { case CENTER: offset -= _getChunkWidth(0) * 0.5; break; -- GitLab From 3b1037c9a631989711a556660f5e15d7b639302e Mon Sep 17 00:00:00 2001 From: Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> Date: Tue, 21 May 2019 14:15:39 +1000 Subject: [PATCH 2/2] Keep text on path centered when empty --- src/text-editing.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/text-editing.cpp b/src/text-editing.cpp index 2ccab04920..af73c41403 100644 --- a/src/text-editing.cpp +++ b/src/text-editing.cpp @@ -1981,6 +1981,7 @@ versions can be removed. I haven't analysed my work in detail to figure out if this is so. */ static bool tidy_xml_tree_recursively(SPObject *root, bool has_text_decoration) { + if (SP_IS_TEXTPATH(root)) return false; gchar const *root_style = (root)->getRepr()->attribute("style"); if(root_style && strstr(root_style,"text-decoration"))has_text_decoration = true; static bool (* const tidy_operators[])(SPObject**, bool) = { -- GitLab