1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2025-04-21 12:27:27 +03:00

Made interactive selection of measurement points a little less inefficient.

- vectors now have their own struct in inst.u and don't share inst.u.rect.end
- when selecting points for measurements, use the highlighting we've already 
  done and don't redo all the O(n^3) searching for each mouse pointer movement
- removed debug code that printed what new measurements are like. We can now 
  use the code view for that.



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5552 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
werner
2009-08-27 09:01:24 +00:00
parent 3497aabf5c
commit c37648e2a5
5 changed files with 33 additions and 30 deletions

12
inst.c
View File

@@ -353,7 +353,7 @@ int inst_find_point_selected(struct coord pos, struct inst **res)
struct coord inst_get_point(const struct inst *inst)
{
if (inst->ops == &vec_ops)
return inst->u.rect.end;
return inst->u.vec.end;
if (inst->ops == &frame_ops)
return inst->base;
abort();
@@ -575,7 +575,7 @@ static void vec_op_select(struct inst *self)
{
status_set_type_entry("ref =");
status_set_name("%s", self->vec->name ? self->vec->name : "");
rect_status(self->base, self->u.rect.end, -1, 0);
rect_status(self->base, self->u.vec.end, -1, 0);
vec_edit(self->vec);
}
@@ -628,7 +628,7 @@ int inst_vec(struct vec *vec, struct coord base)
inst = add_inst(&vec_ops, ip_vec, base);
inst->vec = vec;
inst->u.rect.end = vec->pos;
inst->u.vec.end = vec->pos;
update_bbox(&inst->bbox, vec->pos);
propagate_bbox(inst);
return 1;
@@ -1199,9 +1199,11 @@ void inst_highlight_vecs(int (*pick)(struct inst *inst, void *user), void *user)
struct inst *inst;
int i;
FOR_ALL_INSTS(i, ip_vec, inst)
if (pick(inst, user))
FOR_ALL_INSTS(i, ip_vec, inst) {
inst->u.vec.highlighted = pick(inst, user);
if (inst->u.vec.highlighted)
gui_highlight_vec(inst);
}
}