Commit 7b294b34 authored by yoshiki@chromium.org's avatar yoshiki@chromium.org

Files.app: Prevent a scroolbar from overshooting the border of the view.

BUG=245053
TEST=manual
R=mtomasz@chromium.org

Review URL: https://chromiumcodereview.appspot.com/15761006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203956 0039d316-1c4b-4281-b951-d872f2087c98
parent 174996a3
......@@ -152,6 +152,9 @@ ScrollBar.prototype.onMouseMove_ = function(event) {
var buttonPosition = this.buttonPressedPosition_ +
(event.screenY - this.buttonPressedEvent_.screenY);
// Ensures the scrollbar is in the view.
buttonPosition =
Math.max(0, Math.min(buttonPosition, clientSize - buttonSize));
var scrollPosition = totalSize * (buttonPosition / clientSize);
this.scrollTop_ = scrollPosition;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment