mirror of
git://projects.qi-hardware.com/fped.git
synced 2025-04-21 12:27:27 +03:00
When creating an object in the GUI, its label wasn't initialized. Added
infrastructure for hole objects. (Postscript and KiCad output are still missing, and so does sanity checking.) - gui_tool.c (new_obj_unconnected): set obj->name to NULL - added hole objects to tool bar, all the various GUI routines, the .fpd parser, and the .fpd dumper git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5939 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
31
inst.c
31
inst.c
@@ -909,6 +909,37 @@ int inst_pad(struct obj *obj, const char *name, struct coord a, struct coord b)
|
||||
}
|
||||
|
||||
|
||||
/* ----- hole -------------------------------------------------------------- */
|
||||
|
||||
|
||||
static void hole_op_select(struct inst *self)
|
||||
{
|
||||
rect_status_sort(self->base, self->u.hole.other, -1, 1);
|
||||
}
|
||||
|
||||
|
||||
static struct inst_ops hole_ops = {
|
||||
.draw = gui_draw_hole,
|
||||
.distance = gui_dist_hole,
|
||||
.select = hole_op_select,
|
||||
.draw_move = draw_move_hole,
|
||||
};
|
||||
|
||||
|
||||
int inst_hole(struct obj *obj, struct coord a, struct coord b)
|
||||
{
|
||||
struct inst *inst;
|
||||
|
||||
inst = add_inst(&hole_ops, ip_hole, a);
|
||||
inst->obj = obj;
|
||||
inst->u.hole.other = b;
|
||||
find_inst(inst);
|
||||
update_bbox(&inst->bbox, b);
|
||||
propagate_bbox(inst);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* ----- arc --------------------------------------------------------------- */
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user