From ee2c332a7b5ff75863b5e14bb26f4d52d6f6fdb5 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Wed, 6 Feb 2008 20:18:32 +0000 Subject: bug 189516: text selection highlight is in the wrong place for text-on-path when vertical kerning is applied (bzr r4668) --- src/libnrtype/Layout-TNG-OutIter.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/libnrtype/Layout-TNG-OutIter.cpp b/src/libnrtype/Layout-TNG-OutIter.cpp index 167352bd3..41fd48c9a 100755 --- a/src/libnrtype/Layout-TNG-OutIter.cpp +++ b/src/libnrtype/Layout-TNG-OutIter.cpp @@ -264,14 +264,15 @@ NR::Rect Layout::characterBoundingBox(iterator const &it, double *rotation) cons NR::Point midpoint; NR::Point tangent; Span const &span = _characters[char_index].span(this); - double top = span.baseline_shift - span.line_height.ascent; - double bottom = span.baseline_shift + span.line_height.descent; const_cast(_path_fitted)->PointAndTangentAt(midpoint_otp[0].piece, midpoint_otp[0].t, midpoint, tangent); top_left[NR::X] = midpoint[NR::X] - cluster_half_width; - top_left[NR::Y] = midpoint[NR::Y] + top; + top_left[NR::Y] = midpoint[NR::Y] - span.line_height.ascent; bottom_right[NR::X] = midpoint[NR::X] + cluster_half_width; - bottom_right[NR::Y] = midpoint[NR::Y] + bottom; + bottom_right[NR::Y] = midpoint[NR::Y] + span.line_height.descent; + NR::Point normal = tangent.cw(); + top_left += span.baseline_shift * normal; + bottom_right += span.baseline_shift * normal; if (rotation) *rotation = atan2(tangent[1], tangent[0]); } -- cgit v1.2.3