Author: zooey Date: 2009-11-04 14:55:13 +0100 (Wed, 04 Nov 2009) New Revision: 33877 Changeset: http://dev.haiku-os.org/changeset/33877/haiku Modified: haiku/trunk/src/kits/interface/TextView.cpp Log: * 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) Modified: haiku/trunk/src/kits/interface/TextView.cpp =================================================================== --- haiku/trunk/src/kits/interface/TextView.cpp 2009-11-04 13:28:32 UTC (rev 33876) +++ haiku/trunk/src/kits/interface/TextView.cpp 2009-11-04 13:55:13 UTC (rev 33877) @@ -1809,8 +1809,8 @@ 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 @@ fTextRect.bottom = fTextRect.top + newHeight; if (!fWrap) { fMinTextRectWidth = fLines->MaxWidth(); - fTextRect.right = fTextRect.left + fMinTextRectWidth; + fTextRect.right = ceilf(fTextRect.left + fMinTextRectWidth); } *endLine = lineIndex - 1;