Optimise out scrollbar action induced redraws with no effect.
svn path=/trunk/netsurf/; revision=12688
This commit is contained in:
parent
c35b92acc1
commit
f878fefeed
|
@ -397,6 +397,7 @@ bool scrollbar_redraw(struct scrollbar *s, int x, int y,
|
|||
void scrollbar_set(struct scrollbar *s, int value, bool bar_pos)
|
||||
{
|
||||
int well_length;
|
||||
int old_offset = s->offset;
|
||||
struct scrollbar_msg_data msg;
|
||||
|
||||
if (value < 0)
|
||||
|
@ -426,6 +427,10 @@ void scrollbar_set(struct scrollbar *s, int value, bool bar_pos)
|
|||
((well_length * s->offset) / s->full_size);
|
||||
}
|
||||
|
||||
if (s->offset == old_offset)
|
||||
/* Nothing happened */
|
||||
return;
|
||||
|
||||
msg.scrollbar = s;
|
||||
msg.msg = SCROLLBAR_MSG_MOVED;
|
||||
msg.scroll_offset = s->offset;
|
||||
|
|
Loading…
Reference in New Issue