From 99d85697d2c1a181d34417f2b44cad2ea7ba875c Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 3 Jun 2013 20:00:23 +0100 Subject: Use plot coordinate correctly and use the shifted offset clip rect. --- desktop/treeview.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/desktop/treeview.c b/desktop/treeview.c index cc0e682d3..dc1ed2307 100644 --- a/desktop/treeview.c +++ b/desktop/treeview.c @@ -753,7 +753,7 @@ void treeview_redraw(struct treeview *tree, int x, int y, struct rect *clip, struct rect r; int inset = tree_g.window_padding - tree_g.step_width; uint32_t count = 0; - int render_y = 0; + int render_y = y; int x0, y0, y1; int baseline = (tree_g.line_height * 3 + 2) / 4; enum treeview_resource_id res = TREE_RES_CONTENT; @@ -821,7 +821,7 @@ void treeview_redraw(struct treeview *tree, int x, int y, struct rect *clip, height = (node->type == TREE_NODE_ENTRY) ? node->height : tree_g.line_height; - if ((render_y + tree_g.line_height) < clip->y0) { + if ((render_y + tree_g.line_height) < r.y0) { /* This node's line is above clip region */ render_y += height; continue; @@ -879,7 +879,7 @@ void treeview_redraw(struct treeview *tree, int x, int y, struct rect *clip, /* Rendered the node */ render_y += tree_g.line_height; - if (render_y > clip->y1) { + if (render_y > r.y1) { /* Passed the bottom of what's in the clip region. * Done. */ break; @@ -926,14 +926,14 @@ void treeview_redraw(struct treeview *tree, int x, int y, struct rect *clip, /* Finshed rendering expanded entry */ - if (render_y > clip->y1) { + if (render_y > r.y1) { /* Passed the bottom of what's in the clip region. * Done. */ break; } } - if (render_y < clip->y1) { + if (render_y < r.y1) { /* Fill the blank area at the bottom */ y0 = render_y; new_ctx.plot->rectangle(r.x0, y0, r.x1, r.y1, -- cgit v1.2.3