summaryrefslogtreecommitdiffstats
path: root/src/libnrtype
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2019-09-19 20:52:31 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2019-09-19 20:52:31 +0000
commit1a8e7428f8154f12f66ac4c691c98cc37bb1520e (patch)
tree1e0036d07d3ffba858cb31051bc38e7561f7b271 /src/libnrtype
parentSome styling to search bar (diff)
downloadinkscape-1a8e7428f8154f12f66ac4c691c98cc37bb1520e.tar.gz
inkscape-1a8e7428f8154f12f66ac4c691c98cc37bb1520e.zip
Fix partialy issue 425 (the highlight part not new line one) https://gitlab.com/inkscape/inkscape/issues/425
Diffstat (limited to 'src/libnrtype')
-rw-r--r--src/libnrtype/Layout-TNG-OutIter.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libnrtype/Layout-TNG-OutIter.cpp b/src/libnrtype/Layout-TNG-OutIter.cpp
index 3e9777e6e..630ef1411 100644
--- a/src/libnrtype/Layout-TNG-OutIter.cpp
+++ b/src/libnrtype/Layout-TNG-OutIter.cpp
@@ -459,16 +459,17 @@ std::vector<Geom::Point> Layout::createSelectionShape(iterator const &it_start,
double baseline_y = _spans[span_index].line(this).baseline_y + _spans[span_index].baseline_shift;
double vertical_scale = _glyphs.back().vertical_scale;
+ double offset_y = _spans[span_index].y_offset;
if (_directions_are_orthogonal(_blockProgression(), TOP_TO_BOTTOM)) {
- double span_height = vertical_scale * _spans[span_index].line_height.emSize();
+ double span_height = vertical_scale * _spans[span_index].line_height.emSize();
top_left[Geom::Y] = top_left[Geom::X];
- top_left[Geom::X] = baseline_y - span_height * 0.5;
+ top_left[Geom::X] = offset_y + baseline_y - span_height * 0.5;
bottom_right[Geom::Y] = bottom_right[Geom::X];
- bottom_right[Geom::X] = baseline_y + span_height * 0.5;
+ bottom_right[Geom::X] = offset_y + baseline_y + span_height * 0.5;
} else {
- top_left[Geom::Y] = baseline_y - vertical_scale * _spans[span_index].line_height.ascent;
- bottom_right[Geom::Y] = baseline_y + vertical_scale * _spans[span_index].line_height.descent;
+ top_left[Geom::Y] = offset_y + baseline_y - vertical_scale * _spans[span_index].line_height.ascent;
+ bottom_right[Geom::Y] = offset_y + baseline_y + vertical_scale * _spans[span_index].line_height.descent;
}
}