Slight selection auto-scroll optimisation.

This commit is contained in:
Michael Drake 2013-02-09 11:24:44 +00:00
parent 363d02b8ad
commit 688e1b0e4f
1 changed files with 4 additions and 3 deletions

View File

@ -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);