diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2013-02-09 11:24:44 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2013-02-09 11:24:44 +0000 |
commit | 688e1b0e4ff21b985dd2c212b640f50faa3f0124 (patch) | |
tree | acafe150369712715e907ef5d967d6fcc79c02e1 /desktop | |
parent | 363d02b8ad0b52a18e85f4da0b595b9904eb91f0 (diff) | |
download | netsurf-688e1b0e4ff21b985dd2c212b640f50faa3f0124.tar.gz netsurf-688e1b0e4ff21b985dd2c212b640f50faa3f0124.tar.bz2 |
Slight selection auto-scroll optimisation.
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/textarea.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/desktop/textarea.c b/desktop/textarea.c index 555178065..bfa1327a2 100644 --- a/desktop/textarea.c +++ b/desktop/textarea.c @@ -2150,11 +2150,12 @@ bool textarea_mouse_action(struct textarea *ta, browser_mouse_state mouse, /* selection auto-scroll */ if (x < 0) scrx = x / 4; + else if (x > ta->vis_width) + scrx = (x - ta->vis_width) / 4; + if (y < 0) scry = y / 4; - if (x > ta->vis_width) - scrx = (x - ta->vis_width) / 4; - if (y > ta->vis_height) + else if (y > ta->vis_height) scry = (y - ta->vis_height) / 4; textarea_scroll(ta, scrx, scry); |