Implemented StringWidth in ServerFont, updated ServerApp to use it, and removed a -1 from TextView in the char location calculation, which I didn't understand and without which the cursor location and related stuff now finally work.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12744 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2005-05-20 17:36:55 +00:00
parent 097d641852
commit 38c5a7b7fa
4 changed files with 34 additions and 5 deletions
+4 -1
View File
@@ -1783,7 +1783,10 @@ BTextView::PointAt(int32 inOffset, float *outHeight) const
result.x += modifier;
}
// convert from text rect coordinates
result.x += fTextRect.left - 1.0;
// NOTE: I didn't understand why "- 1.0"
// and it works only correct without it on Haiku app_server.
// Feel free to enlighten me though!
result.x += fTextRect.left;// - 1.0;
// round up
result.x = ceil(result.x);