Mercurial > MadButterfly
comparison src/event.c @ 747:d2f2ed27b84d
Separate GEF_NOT_SHOWED and GEF_HIDDEN flags.
GEF_HIDDEN mark a geo (shape) can not be showed, GEF_NOT_SHOWED is
implied by GEF_HIDDEN or one of ancesters that is hidden. Redraw
manager use GEF_NOT_SHOWED to determine who is not showed, actually.
GEF_NOT_SHOWED is flaged when clean_shape().
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Wed, 25 Aug 2010 18:22:32 +0800 |
parents | 6e18550c8fa8 |
children | 586e50f82c1f |
comparison
equal
deleted
inserted
replaced
746:1dbc74a14199 | 747:d2f2ed27b84d |
---|---|
133 }; | 133 }; |
134 typedef struct mb_obj mb_obj_t; | 134 typedef struct mb_obj mb_obj_t; |
135 #define MB_OBJ_INIT(obj, type) do { (obj)->obj_type = type; } while(0) | 135 #define MB_OBJ_INIT(obj, type) do { (obj)->obj_type = type; } while(0) |
136 | 136 |
137 #define GEF_OV_DRAW 0x1 | 137 #define GEF_OV_DRAW 0x1 |
138 #define GEF_HIDDEN 0x2 | 138 #define GEF_NOT_SHOWED 0x20 |
139 | 139 |
140 struct shape { | 140 struct shape { |
141 mb_obj_t obj; | 141 mb_obj_t obj; |
142 | 142 |
143 coord_t *coord; | 143 coord_t *coord; |
609 int i, r; | 609 int i, r; |
610 | 610 |
611 cr = rdman_get_cr(rdman); | 611 cr = rdman_get_cr(rdman); |
612 for(i = rdman_shape_gl_len(rdman) - 1; i >= 0; i--) { | 612 for(i = rdman_shape_gl_len(rdman) - 1; i >= 0; i--) { |
613 shape = rdman_get_shape_gl(rdman, i); | 613 shape = rdman_get_shape_gl(rdman, i); |
614 if(sh_get_flags(shape, GEF_HIDDEN)) | 614 if(sh_get_flags(shape, GEF_NOT_SHOWED)) |
615 continue; | 615 continue; |
616 r = _shape_pos_is_in(shape, x, y, in_stroke, cr); | 616 r = _shape_pos_is_in(shape, x, y, in_stroke, cr); |
617 if(r) | 617 if(r) |
618 return shape; | 618 return shape; |
619 } | 619 } |