summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp@users.sourceforge.net <dgp>2005-05-10 21:36:35 (GMT)
committerdgp@users.sourceforge.net <dgp>2005-05-10 21:36:35 (GMT)
commitac7b3bc047009b844d3bf181769e866a982eae6f (patch)
tree8dd31bde7b5085a15d32cbc44c42b2be67dfc55d /generic
parent0bcd1d40394fa5503df0eabe229485af2f23dbed (diff)
downloadtk-ac7b3bc047009b844d3bf181769e866a982eae6f.zip
tk-ac7b3bc047009b844d3bf181769e866a982eae6f.tar.gz
tk-ac7b3bc047009b844d3bf181769e866a982eae6f.tar.bz2
* generic/tkTextDisp.c (GetXView): Improved numerical precision
of calculation of [.t xview] return values. * tests/textDisp.test: Match greater precisions of [.t xview] and [.t yview] values in tests.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkTextDisp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index f85e0db..21f9e4b 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkTextDisp.c,v 1.48 2005/03/15 14:07:47 vincentdarley Exp $
+ * RCS: @(#) $Id: tkTextDisp.c,v 1.49 2005/05/10 21:36:37 dgp Exp $
*/
#include "tkPort.h"
@@ -5808,8 +5808,8 @@ GetXView(interp, textPtr, report)
if (dInfoPtr->maxLength > 0) {
first = ((double) dInfoPtr->curXPixelOffset)
/ dInfoPtr->maxLength;
- last = first + ((double) (dInfoPtr->maxX - dInfoPtr->x))
- / dInfoPtr->maxLength;
+ last = ((double) (dInfoPtr->curXPixelOffset + dInfoPtr->maxX
+ - dInfoPtr->x))/dInfoPtr->maxLength;
if (last > 1.0) {
last = 1.0;
}