aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMarko Njezic <devnull@localhost>2012-02-09 23:37:57 +0100
committerMarko Njezic <devnull@localhost>2012-02-09 23:37:57 +0100
commit8c13707376317611de50cdee3f48e158c15ec061 (patch)
treec28eb3d8bde8f145525b5692823a863959c7789f
parenta7bed10b77d4630ad2a6b1a92abe43ac758662d4 (diff)
downloadscintilla-mirror-8c13707376317611de50cdee3f48e158c15ec061.tar.gz
Fix rounding issue in SPositionFromLocation() that started with introduction of
fractional positioning. Bug #3485669.
-rw-r--r--src/Editor.cxx2
1 files changed, 1 insertions, 1 deletions
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<int>(pt.y) - (vs.lineHeight - 1)) / vs.lineHeight + topLine;
}
if (!canReturnInvalid && (visibleLine < 0))
visibleLine = 0;