From fc2baa9ab83b3cb1ad59d1f6d9a164d36b9c1f84 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: 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 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; -- cgit v1.2.3