Mercurial > MadButterfly
comparison include/mb_redraw_man.h @ 490:5d0b2761f89c Android_Skia
Reset stroke and fill for shapes when a paint is freed.
- reset stroke or/and fill of shapes with a freeing paint.
- remove a shape from member lists of paints of stroke and fill when
the shape being freed.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Mon, 23 Nov 2009 18:04:22 +0800 |
parents | af4b506ad56f |
children | 4291f16f3a09 |
comparison
equal
deleted
inserted
replaced
489:23c7667b3ec0 | 490:5d0b2761f89c |
---|---|
155 paint_t *paint, | 155 paint_t *paint, |
156 shape_t *shape); | 156 shape_t *shape); |
157 #define _rdman_paint_remove_child(rdman, paint, shape) \ | 157 #define _rdman_paint_remove_child(rdman, paint, shape) \ |
158 do { \ | 158 do { \ |
159 if((shape)->fill == (shape)->stroke && \ | 159 if((shape)->fill == (shape)->stroke && \ |
160 (shape)->stroke == paint) \ | 160 (shape)->stroke == (paint)) \ |
161 break; \ | 161 break; \ |
162 _rdman_paint_real_remove_child(rdman, paint, shape); \ | 162 _rdman_paint_real_remove_child(rdman, paint, shape); \ |
163 } while(0) | 163 } while(0) |
164 #define rdman_paint_fill(rdman, paint, shape) \ | 164 #define rdman_paint_fill(rdman, paint, shape) \ |
165 do { \ | 165 do { \ |
166 if((shape)->fill == paint) \ | 166 if((shape)->fill == paint) \ |
167 break; \ | 167 break; \ |
168 _rdman_paint_remove_child(rdman, paint, shape); \ | 168 if((shape)->fill) \ |
169 _rdman_paint_child(rdman, paint, shape); \ | 169 _rdman_paint_remove_child(rdman, (shape)->fill, \ |
170 (shape)->fill = paint; \ | 170 shape); \ |
171 } while(0) | 171 if(paint) \ |
172 #define rdman_paint_stroke(rdman, paint, shape) \ | 172 _rdman_paint_child(rdman, paint, shape); \ |
173 do { \ | 173 (shape)->fill = paint; \ |
174 if((shape)->stroke == paint) \ | 174 } while(0) |
175 break; \ | 175 #define rdman_paint_stroke(rdman, paint, shape) \ |
176 _rdman_paint_remove_child(rdman, paint, shape); \ | 176 do { \ |
177 _rdman_paint_child(rdman, paint, shape); \ | 177 if((shape)->stroke == paint) \ |
178 (shape)->stroke = paint; \ | 178 break; \ |
179 if((shape)->stroke) \ | |
180 _rdman_paint_remove_child(rdman, (shape)->stroke, \ | |
181 shape); \ | |
182 if(paint) \ | |
183 _rdman_paint_child(rdman, paint, shape); \ | |
184 (shape)->stroke = paint; \ | |
179 } while(0) | 185 } while(0) |
180 extern int rdman_paint_changed(redraw_man_t *rdman, paint_t *paint); | 186 extern int rdman_paint_changed(redraw_man_t *rdman, paint_t *paint); |
181 | 187 |
182 extern shape_t *find_shape_at_pos(redraw_man_t *rdman, | 188 extern shape_t *find_shape_at_pos(redraw_man_t *rdman, |
183 co_aix x, co_aix y, int *in_stroke); | 189 co_aix x, co_aix y, int *in_stroke); |