Mercurial > geeqie
changeset 853:b54e3fc9cafb
optimized marks drawing
author | nadvornik |
---|---|
date | Sun, 22 Jun 2008 20:07:32 +0000 |
parents | 8308d3606991 |
children | a0cdc9d066ae |
files | src/cellrenderericon.c |
diffstat | 1 files changed, 11 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/cellrenderericon.c Sun Jun 22 20:01:20 2008 +0000 +++ b/src/cellrenderericon.c Sun Jun 22 20:07:32 2008 +0000 @@ -702,14 +702,18 @@ pix_rect.x = cell_area->x + cell->xpad + (cell_rect.width - pix_rect.width + 1) / 2 + (TOGGLE_SPACING - TOGGLE_WIDTH) / 2; pix_rect.y = cell_area->y + cell->ypad + (cell_rect.height - pix_rect.height) + (TOGGLE_SPACING - TOGGLE_WIDTH) / 2; - for (i = 0; i < cellicon->num_marks; i++) + if (gdk_rectangle_intersect(cell_area, &pix_rect, &draw_rect) && + gdk_rectangle_intersect(expose_area, &draw_rect, &draw_rect)) { - gtk_paint_check (widget->style, window, - state, (cellicon->marks & (1 << i)) ? GTK_SHADOW_IN : GTK_SHADOW_OUT, - cell_area, widget, "cellcheck", - pix_rect.x + i * TOGGLE_SPACING + (TOGGLE_WIDTH - TOGGLE_SPACING) / 2, - pix_rect.y, - TOGGLE_WIDTH, TOGGLE_WIDTH); + for (i = 0; i < cellicon->num_marks; i++) + { + gtk_paint_check (widget->style, window, + state, (cellicon->marks & (1 << i)) ? GTK_SHADOW_IN : GTK_SHADOW_OUT, + cell_area, widget, "cellcheck", + pix_rect.x + i * TOGGLE_SPACING + (TOGGLE_WIDTH - TOGGLE_SPACING) / 2, + pix_rect.y, + TOGGLE_WIDTH, TOGGLE_WIDTH); + } } }