From 688e1b0e4ff21b985dd2c212b640f50faa3f0124 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 9 Feb 2013 11:24:44 +0000 Subject: Slight selection auto-scroll optimisation. --- desktop/textarea.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'desktop/textarea.c') 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); -- cgit v1.2.3