diff options
author | nyamatongwe <nyamatongwe@gmail.com> | 2012-10-13 22:26:55 +1100 |
---|---|---|
committer | nyamatongwe <nyamatongwe@gmail.com> | 2012-10-13 22:26:55 +1100 |
commit | 5cea9c55549a91c6f9cf08555396ce4a90ceb5c7 (patch) | |
tree | e0737c665d5677531df7f58096a99d9d441c0e88 | |
parent | 53908be0d1a58079425419ddb214dd8b20b81a4e (diff) | |
download | scintilla-mirror-5cea9c55549a91c6f9cf08555396ce4a90ceb5c7.tar.gz |
Limit horizontal scroll value so that it does not go negative when swiping
touchpad with a small scroll width.
-rw-r--r-- | cocoa/ScintillaCocoa.mm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index fb584b9c5..64981d9d6 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -1536,6 +1536,8 @@ void ScintillaCocoa::SetHorizontalScrollPos() // Convert absolute coordinate into the range [0..1]. Keep in mind that the visible area // does *not* belong to the scroll range. int maxXOffset = scrollWidth - textRect.Width(); + if (maxXOffset < 0) + maxXOffset = 0; if (xOffset > maxXOffset) xOffset = maxXOffset; float relativePosition = (float) xOffset / maxXOffset; |