Changeset 5552
- Timestamp:
- 08/27/09 11:01:24 (4 years ago)
- Location:
- trunk/eda/fped
- Files:
-
- 5 edited
-
gui_inst.c (modified) (4 diffs)
-
gui_meas.c (modified) (8 diffs)
-
gui_tool.c (modified) (2 diffs)
-
inst.c (modified) (4 diffs)
-
inst.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eda/fped/gui_inst.c
r5527 r5552 123 123 unit_type d; 124 124 125 d = dist_point(pos, self->u. rect.end)/scale;125 d = dist_point(pos, self->u.vec.end)/scale; 126 126 return d > VEC_EYE_R ? -1 : d; 127 127 } … … 139 139 unit_type d; 140 140 141 d = dist_line(pos, self->base, self->u. rect.end)/scale;141 d = dist_line(pos, self->base, self->u.vec.end)/scale; 142 142 return d > SELECT_R ? -1 : d; 143 143 } … … 146 146 void gui_highlight_vec(struct inst *self) 147 147 { 148 struct coord center = translate(self->u. rect.end);148 struct coord center = translate(self->u.vec.end); 149 149 150 150 draw_circle(DA, gc_highlight, FALSE, center.x, center.y, VEC_EYE_R); … … 155 155 { 156 156 struct coord from = translate(self->base); 157 struct coord to = translate(self->u. rect.end);157 struct coord to = translate(self->u.vec.end); 158 158 GdkGC *gc; 159 159 -
trunk/eda/fped/gui_meas.c
r5478 r5552 65 65 66 66 min = meas_find_min(lt, active_pkg->samples[inst->vec->n]); 67 return coord_eq(inst->u. rect.end, min);67 return coord_eq(inst->u.vec.end, min); 68 68 } 69 69 … … 75 75 76 76 next = meas_find_next(lt, active_pkg->samples[inst->vec->n], 77 ref->u. rect.end);78 return coord_eq(inst->u. rect.end, next);77 ref->u.vec.end); 78 return coord_eq(inst->u.vec.end, next); 79 79 } 80 80 … … 85 85 86 86 max = meas_find_max(lt, active_pkg->samples[inst->vec->n]); 87 return coord_eq(inst->u. rect.end, max);87 return coord_eq(inst->u.vec.end, max); 88 88 } 89 89 … … 98 98 next = meas_find_next(lt, active_pkg->samples[inst->vec->n], 99 99 min); 100 if (coord_eq(next, inst->u. rect.end))100 if (coord_eq(next, inst->u.vec.end)) 101 101 return 1; 102 102 } … … 113 113 min = meas_find_min(lt, inst->vec->samples); 114 114 next = meas_find_next(lt, ref->vec->samples, min); 115 return coord_eq(next, ref->u. rect.end);115 return coord_eq(next, ref->u.vec.end); 116 116 } 117 117 #endif … … 235 235 236 236 237 static int is_highlighted(struct inst *inst, void *user) 238 { 239 return inst->u.vec.highlighted; 240 } 241 242 237 243 static struct inst *find_point_meas_new(struct coord pos) 238 244 { 239 if (meas_inst) 240 return inst_find_vec(pos, meas_pick_vec_b, meas_inst); 241 else 242 return inst_find_vec(pos, meas_pick_vec_a, NULL); 245 return inst_find_vec(pos, is_highlighted, NULL); 243 246 } 244 247 … … 303 306 meas->inverted = 304 307 mode == min_to_next_or_max && is_min(meas_dsc->lt, to) ? 0 : 305 meas_dsc->lt(from->u. rect.end, to->u.rect.end) !=308 meas_dsc->lt(from->u.vec.end, to->u.vec.end) != 306 309 (mode == min_to_next_or_max); 307 {308 char *sm[] = { "min_to", "max_to", "next_to" };309 char *st[] = { "nxy", "nx", "ny", "mxy", "mx", "my" };310 fprintf(stderr, "mode %s type %s, inverted %d\n",311 sm[mode], st[meas->type], meas->inverted);312 }313 310 meas->offset = NULL; 314 311 meas_dsc = NULL; … … 389 386 struct inst *find_point_meas_move(struct inst *inst, struct coord pos) 390 387 { 391 return inst_find_vec(pos, meas_pick_vec_b, meas_inst);388 return inst_find_vec(pos, is_highlighted, NULL); 392 389 } 393 390 -
trunk/eda/fped/gui_tool.c
r5525 r5552 275 275 { 276 276 return draw_move_line_common(inst, 277 add_vec(sub_vec(inst->u. rect.end, inst->base), pos), pos, i);277 add_vec(sub_vec(inst->u.vec.end, inst->base), pos), pos, i); 278 278 } 279 279 … … 282 282 { 283 283 return hover_common(gc_vec[mode_hover], 284 self->u. rect.end, VEC_EYE_R);284 self->u.vec.end, VEC_EYE_R); 285 285 } 286 286 -
trunk/eda/fped/inst.c
r5527 r5552 354 354 { 355 355 if (inst->ops == &vec_ops) 356 return inst->u. rect.end;356 return inst->u.vec.end; 357 357 if (inst->ops == &frame_ops) 358 358 return inst->base; … … 576 576 status_set_type_entry("ref ="); 577 577 status_set_name("%s", self->vec->name ? self->vec->name : ""); 578 rect_status(self->base, self->u. rect.end, -1, 0);578 rect_status(self->base, self->u.vec.end, -1, 0); 579 579 vec_edit(self->vec); 580 580 } … … 629 629 inst = add_inst(&vec_ops, ip_vec, base); 630 630 inst->vec = vec; 631 inst->u. rect.end = vec->pos;631 inst->u.vec.end = vec->pos; 632 632 update_bbox(&inst->bbox, vec->pos); 633 633 propagate_bbox(inst); … … 1200 1200 int i; 1201 1201 1202 FOR_ALL_INSTS(i, ip_vec, inst) 1203 if (pick(inst, user)) 1202 FOR_ALL_INSTS(i, ip_vec, inst) { 1203 inst->u.vec.highlighted = pick(inst, user); 1204 if (inst->u.vec.highlighted) 1204 1205 gui_highlight_vec(inst); 1206 } 1205 1207 } 1206 1208 -
trunk/eda/fped/inst.h
r5527 r5552 80 80 union { 81 81 struct { 82 int highlighted; /* for measurements */ 83 struct coord end; 84 } vec; 85 struct { 82 86 struct frame *ref; 83 87 int active; … … 85 89 const char *name; 86 90 struct { 91 unit_type width; 87 92 struct coord end; 88 unit_type width;89 93 } rect; 90 94 struct {
Note: See TracChangeset
for help on using the changeset viewer.
