From 3fe18eddaeb277a48d32b1198e2981b673375a6e Mon Sep 17 00:00:00 2001 From: cyreve Date: Wed, 6 Feb 2008 20:18:32 +0000 Subject: [PATCH] bug 189516: text selection highlight is in the wrong place for text-on-path when vertical kerning is applied --- src/libnrtype/Layout-TNG-OutIter.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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]); } -- 2.30.2