comparison src/shape_rect.c @ 270:cd6af7da32c9

Fix the problem that clean_canvas() can not clean canvas cleanly. - For some unknown reasons, cairo_paint() can not clean painted graphics cleanly. - Use cairo_rectangle() and cairo_fill() to replace cairo_paint().
author Thinker K.F. Li <thinker@branda.to>
date Sun, 25 Jan 2009 16:07:43 +0800
parents 29e1b2bffe4c
children 16116d84bc5e
comparison
equal deleted inserted replaced
269:c96f38ad4bb6 270:cd6af7da32c9
120 } 120 }
121 121
122 if(shape->stroke) { 122 if(shape->stroke) {
123 area = shape->geo->cur_area; 123 area = shape->geo->cur_area;
124 width = shape->stroke_width; 124 width = shape->stroke_width;
125 area->x -= width / 2 + 1; 125 area->x -= width / 2 + 0.5;
126 area->y -= width / 2 + 1; 126 area->y -= width / 2 + 0.5;
127 area->w += width + 2; 127 area->w += width + 1;
128 area->h += width + 2; 128 area->h += width + 1;
129 } 129 }
130 } 130 }
131 131
132 void sh_rect_draw(shape_t *shape, cairo_t *cr) { 132 void sh_rect_draw(shape_t *shape, cairo_t *cr) {
133 sh_rect_t *rect = (sh_rect_t *)shape; 133 sh_rect_t *rect = (sh_rect_t *)shape;