summaryrefslogtreecommitdiff
path: root/svgio/source/svgreader/svgcharacternode.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svgio/source/svgreader/svgcharacternode.cxx')
-rw-r--r--svgio/source/svgreader/svgcharacternode.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/svgio/source/svgreader/svgcharacternode.cxx b/svgio/source/svgreader/svgcharacternode.cxx
index 8a6610c91d25..bfd17c6e0d58 100644
--- a/svgio/source/svgreader/svgcharacternode.cxx
+++ b/svgio/source/svgreader/svgcharacternode.cxx
@@ -359,17 +359,19 @@ namespace svgio::svgreader
}
}
+ // Use the whole text line to calculate the align position
+ double fWholeTextLineWidth(aTextLayouterDevice.getTextWidth(getWholeTextLine(), 0, getWholeTextLine().getLength()));
// apply TextAlign
switch(aTextAlign)
{
case TextAlign::right:
{
- aPosition.setX(aPosition.getX() - fTextWidth);
+ aPosition.setX(aPosition.getX() - fWholeTextLineWidth);
break;
}
case TextAlign::center:
{
- aPosition.setX(aPosition.getX() - (fTextWidth * 0.5));
+ aPosition.setX(aPosition.getX() - (fWholeTextLineWidth * 0.5));
break;
}
case TextAlign::notset: