diff options
| author | Richard Hughes <cyreve@gmail.com> | 2008-02-06 20:18:32 +0000 |
|---|---|---|
| committer | cyreve <cyreve@users.sourceforge.net> | 2008-02-06 20:18:32 +0000 |
| commit | ee2c332a7b5ff75863b5e14bb26f4d52d6f6fdb5 (patch) | |
| tree | b4163536b56f207cd838d0bdc94eae9e55c4c016 /src | |
| parent | Fix for bug 168978 (diff) | |
| download | inkscape-ee2c332a7b5ff75863b5e14bb26f4d52d6f6fdb5.tar.gz inkscape-ee2c332a7b5ff75863b5e14bb26f4d52d6f6fdb5.zip | |
bug 189516: text selection highlight is in the wrong place for text-on-path when vertical kerning is applied
(bzr r4668)
Diffstat (limited to 'src')
| -rwxr-xr-x | src/libnrtype/Layout-TNG-OutIter.cpp | 9 |
1 files 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*>(_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]); } |
