summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2019-04-15 09:27:04 +0000
committerTavmjong Bah <tavmjong@free.fr>2019-04-15 09:27:04 +0000
commit779ded10d53efb0e4d2641ac4d0539b02a275afd (patch)
tree502f419c809077221138db3f855e6dabacbc0ca2 /src
parentFix nullptr deref after connector delete (diff)
downloadinkscape-779ded10d53efb0e4d2641ac4d0539b02a275afd.tar.gz
inkscape-779ded10d53efb0e4d2641ac4d0539b02a275afd.zip
Fix for line positioning in wrapped multi-line text.
Bug introduced in 605ef4a43ea0cf89d19d46679e9e0b5bb9e464b2 which applied line correction to all types of text rather than just multi-line text via sodipodi:role = "line".
Diffstat (limited to 'src')
-rw-r--r--src/libnrtype/Layout-TNG-Compute.cpp2
-rw-r--r--src/object/sp-text.cpp5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/libnrtype/Layout-TNG-Compute.cpp b/src/libnrtype/Layout-TNG-Compute.cpp
index f31fffa86..76a1e4708 100644
--- a/src/libnrtype/Layout-TNG-Compute.cpp
+++ b/src/libnrtype/Layout-TNG-Compute.cpp
@@ -1894,7 +1894,7 @@ bool Layout::Calculator::calculate()
// know how to find the top of the box from the 'y' position until we have found the
// line height parameters for the given line (after calling _findChunksForLine() just
// above).
- if (para.first_input_index == 0) {
+ if (para.first_input_index == 0 && (_flow.wrap_mode == WRAP_NONE)) {
// Calculate new top of box... given specified baseline.
double top_of_line_box = _scanline_maker->yCoordinate(); // Set in constructor.
diff --git a/src/object/sp-text.cpp b/src/object/sp-text.cpp
index cb9e5c3f3..49052d92c 100644
--- a/src/object/sp-text.cpp
+++ b/src/object/sp-text.cpp
@@ -570,6 +570,11 @@ void SPText::_buildLayoutInit()
layout.appendWrapShape( uncross );
delete shape;
+
+ } else if (style->white_space.value == SP_CSS_WHITE_SPACE_PRE ||
+ style->white_space.value == SP_CSS_WHITE_SPACE_PREWRAP ||
+ style->white_space.value == SP_CSS_WHITE_SPACE_PRELINE ) {
+ layout.wrap_mode = Inkscape::Text::Layout::WRAP_WHITE_SPACE;
}
} // if (style)