summaryrefslogtreecommitdiffstats
path: root/src/libnrtype
diff options
context:
space:
mode:
authorNathan Lee <2431820-nathanal@users.noreply.gitlab.com>2019-05-21 04:15:00 +0000
committerNathan Lee <2431820-nathanal@users.noreply.gitlab.com>2019-05-26 10:33:11 +0000
commitfc2baa9ab83b3cb1ad59d1f6d9a164d36b9c1f84 (patch)
tree2c776c6427256a3bdd252def2680d5903b0d5cb8 /src/libnrtype
parentRemove some couts and delete uneeded LPE parameter (diff)
downloadinkscape-fc2baa9ab83b3cb1ad59d1f6d9a164d36b9c1f84.tar.gz
inkscape-fc2baa9ab83b3cb1ad59d1f6d9a164d36b9c1f84.zip
Add check for empty text on path
Fixes https://gitlab.com/inkscape/inkscape/issues/261
Diffstat (limited to 'src/libnrtype')
-rw-r--r--src/libnrtype/Layout-TNG-Output.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libnrtype/Layout-TNG-Output.cpp b/src/libnrtype/Layout-TNG-Output.cpp
index a3c11133b..812abba58 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;