From baa3366093870ef1ca2fe94a3128e4a0822a7ed0 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Wed, 4 Nov 2009 13:55:13 +0000 Subject: [PATCH] * the textrect.right should always be rounded up to the next integer - fixes #4894 * PointAt() now rounds x- and y-positions to the next integer instead of always rounding them up - this yields improved caret-positions (e.g. before an 'f' character) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33877 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/TextView.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kits/interface/TextView.cpp b/src/kits/interface/TextView.cpp index 8396b275e6..ce879ab4c8 100644 --- a/src/kits/interface/TextView.cpp +++ b/src/kits/interface/TextView.cpp @@ -1809,8 +1809,8 @@ BTextView::PointAt(int32 inOffset, float *outHeight) const result.x += fTextRect.left; // round up - result.x = ceilf(result.x); - result.y = ceilf(result.y); + result.x = lroundf(result.x); + result.y = lroundf(result.y); if (outHeight != NULL) *outHeight = height; @@ -3792,7 +3792,7 @@ BTextView::_RecalculateLineBreaks(int32 *startLine, int32 *endLine) fTextRect.bottom = fTextRect.top + newHeight; if (!fWrap) { fMinTextRectWidth = fLines->MaxWidth(); - fTextRect.right = fTextRect.left + fMinTextRectWidth; + fTextRect.right = ceilf(fTextRect.left + fMinTextRectWidth); } *endLine = lineIndex - 1;