diff options
author | Marko Njezic <unknown> | 2012-02-09 23:37:57 +0100 |
---|---|---|
committer | Marko Njezic <unknown> | 2012-02-09 23:37:57 +0100 |
commit | 5bb80c3a74234ca11aa42bafc3af38f0fe782722 (patch) | |
tree | a3c4d2e9de74b76645bc90ef4961ff4bcc2bd800 | |
parent | 924742e901072eeb552a51e5dab916d9fa245e67 (diff) | |
download | scintilla-mirror-5bb80c3a74234ca11aa42bafc3af38f0fe782722.tar.gz |
Fix rounding issue in SPositionFromLocation() that started with introduction of
fractional positioning. Bug #3485669.
-rw-r--r-- | src/Editor.cxx | 2 |
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; |