summaryrefslogtreecommitdiff
path: root/desktop/scroll.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-02-14 17:57:08 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-02-14 17:57:08 +0000
commitc05333fa62c6dfdd76f20d8a4056bd66f6e9cddd (patch)
tree7f0035c9af11b1e67225d353846e6ec3434fc878 /desktop/scroll.c
parent60c74c2e3c0190313e039fbb77dcd433921a3f72 (diff)
downloadnetsurf-c05333fa62c6dfdd76f20d8a4056bd66f6e9cddd.tar.gz
netsurf-c05333fa62c6dfdd76f20d8a4056bd66f6e9cddd.tar.bz2
Pass clip rect to scroll_redraw as struct. Simplify test to see if scrollbar is within clip rect.
svn path=/trunk/netsurf/; revision=11679
Diffstat (limited to 'desktop/scroll.c')
-rw-r--r--desktop/scroll.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/desktop/scroll.c b/desktop/scroll.c
index bfa17f9c8..19efa8df5 100644
--- a/desktop/scroll.c
+++ b/desktop/scroll.c
@@ -203,8 +203,7 @@ static inline bool scroll_redraw_scrollbar_rectangle(
* \param scale scale for the redraw
* \return true on succes false otherwise
*/
-bool scroll_redraw(struct scroll *scroll, int x, int y,
- int clip_x0, int clip_y0, int clip_x1, int clip_y1,
+bool scroll_redraw(struct scroll *scroll, int x, int y, struct rect *clip,
float scale)
{
int w = SCROLLBAR_WIDTH;
@@ -247,26 +246,11 @@ bool scroll_redraw(struct scroll *scroll, int x, int y,
bar_c0 = (scroll->horizontal ? x0 : y0) + w + bar_off;
- if (clip_x0 < x0)
- clip_x0 = x0;
-
- if (clip_y0 < y0)
- clip_y0 = y0;
-
- if (clip_x1 > x1 + 1)
- clip_x1 = x1 + 1;
-
- if (clip_y1 > y1 + 1)
- clip_y1 = y1 + 1;
-
-
- if (clip_x0 > clip_x1 || clip_y0 > clip_y1)
- /* clipping rectangle is outside the scrollbar area */
+ if (x1 < clip->x0 || y1 < clip->y0 || clip->x1 < x0 || clip->y1 < y0)
+ /* scrollbar is outside the clipping rectangle, nothing to
+ * render */
return true;
- if (!plot.clip(clip_x0, clip_y0, clip_x1, clip_y1))
- return false;
-
if (scroll->horizontal) {
/* scroll is horizontal */