Changeset 5366
- Timestamp:
- 08/02/09 07:36:21 (4 years ago)
- Location:
- developers/werner/fped
- Files:
-
- 4 edited
-
TODO (modified) (1 diff)
-
gui_inst.c (modified) (1 diff)
-
gui_inst.h (modified) (1 diff)
-
inst.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
developers/werner/fped/TODO
r5365 r5366 18 18 19 19 Style: 20 - stack elements (2a): all inactive below all active21 - stack elements (2b): unselected below selected22 20 - make column of entry field greedily consume all unallocated space 23 21 -
developers/werner/fped/gui_inst.c
r5365 r5366 141 141 d = dist_point(pos, self->u.end)/scale; 142 142 return d > VEC_EYE_R ? -1 : d; 143 } 144 145 146 /* 147 * The circles at a vector's tip enjoy the highest selection priority. However, 148 * users will probably also expected a click on a nicely exposed stem to work. 149 * So we give it second look after having exhausted all other options. 150 */ 151 152 unit_type gui_dist_vec_fallback(struct inst *self, struct coord pos, 153 unit_type scale) 154 { 155 unit_type d; 156 157 d = dist_line(pos, self->base, self->u.end)/scale; 158 return d > SELECT_R ? -1 : d; 143 159 } 144 160 -
developers/werner/fped/gui_inst.h
r5364 r5366 32 32 33 33 unit_type gui_dist_vec(struct inst *self, struct coord pos, unit_type scale); 34 unit_type gui_dist_vec_fallback(struct inst *self, struct coord pos, 35 unit_type scale); 34 36 unit_type gui_dist_line(struct inst *self, struct coord pos, unit_type scale); 35 37 unit_type gui_dist_rect(struct inst *self, struct coord pos, unit_type scale); -
developers/werner/fped/inst.c
r5365 r5366 130 130 deselect_outside(); 131 131 edit_nothing(); 132 selected_inst = NULL; 132 133 FOR_INST_PRIOS_DOWN(prio) { 133 selected_inst = NULL;134 134 for (inst = insts[prio]; inst; inst = inst->next) { 135 135 if (!inst->active || !inst->ops->distance) … … 141 141 } 142 142 } 143 if (selected_inst) { 144 set_path(1); 145 if (selected_inst->ops->select) 146 selected_inst->ops->select(selected_inst); 147 return 1; 143 if (selected_inst) 144 goto selected; 145 } 146 147 /* give vectors a second chance */ 148 149 for (inst = insts[ip_vec]; inst; inst = inst->next) { 150 if (!inst->active) 151 continue; 152 dist = gui_dist_vec_fallback(inst, pos, ctx->scale); 153 if (dist >= 0 && (!selected_inst || best_dist > dist)) { 154 selected_inst = inst; 155 best_dist = dist; 148 156 } 149 157 } 150 return 0; 158 159 if (!selected_inst) 160 return 0; 161 162 selected: 163 set_path(1); 164 if (selected_inst->ops->select) 165 selected_inst->ops->select(selected_inst); 166 return 1; 151 167 } 152 168 … … 616 632 617 633 FOR_INSTS_UP(prio, inst) 618 if ( inst->ops->draw)634 if (!inst->active && inst->ops->draw) 619 635 inst->ops->draw(inst, ctx); 636 FOR_INSTS_UP(prio, inst) 637 if (inst->active && inst != selected_inst && inst->ops->draw) 638 inst->ops->draw(inst, ctx); 639 if (selected_inst && selected_inst->ops->draw) 640 selected_inst->ops->draw(selected_inst, ctx); 620 641 } 621 642
Note: See TracChangeset
for help on using the changeset viewer.
