diff options
author | nyamatongwe <nyamatongwe@gmail.com> | 2012-07-25 15:12:31 +1000 |
---|---|---|
committer | nyamatongwe <nyamatongwe@gmail.com> | 2012-07-25 15:12:31 +1000 |
commit | ad4463926ee7907daaa434230bac4d28e8a2a7b5 (patch) | |
tree | 25322adce117eab5fcfdac8dbadd34b157232d88 | |
parent | 6728875a9748d11ca2fb92ad36a2e640b03aed38 (diff) | |
download | scintilla-mirror-ad4463926ee7907daaa434230bac4d28e8a2a7b5.tar.gz |
Limit horizontal touch scrolling to existing established width.
-rw-r--r-- | cocoa/ScintillaCocoa.mm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index afb0d35cb..7fc07c7c1 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -1538,7 +1538,10 @@ 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. - float relativePosition = (float) xOffset / (scrollWidth - textRect.Width()); + int maxXOffset = scrollWidth - textRect.Width(); + if (xOffset > maxXOffset) + xOffset = maxXOffset; + float relativePosition = (float) xOffset / maxXOffset; [topContainer setHorizontalScrollPosition: relativePosition]; MoveFindIndicatorWithBounce(NO); } |