From 5bb80c3a74234ca11aa42bafc3af38f0fe782722 Mon Sep 17 00:00:00 2001 From: Marko Njezic Date: Thu, 9 Feb 2012 23:37:57 +0100 Subject: Fix rounding issue in SPositionFromLocation() that started with introduction of fractional positioning. Bug #3485669. --- src/Editor.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index a6b699298..2da4a2c9c 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -486,7 +486,7 @@ SelectionPosition Editor::SPositionFromLocation(Point pt, bool canReturnInvalid, pt.x = pt.x - vs.fixedColumnWidth + xOffset; int visibleLine = pt.y / vs.lineHeight + topLine; if (pt.y < 0) { // Division rounds towards 0 - visibleLine = (pt.y - (vs.lineHeight - 1)) / vs.lineHeight + topLine; + visibleLine = (static_cast(pt.y) - (vs.lineHeight - 1)) / vs.lineHeight + topLine; } if (!canReturnInvalid && (visibleLine < 0)) visibleLine = 0; -- cgit v1.2.3