mirror of
git://projects.qi-hardware.com/fped.git
synced 2025-04-21 12:27:27 +03:00
Added delete/undelete.
- when moving a point, we no longer restrict the area around the original position once the drag radius has been left - objects can now be deleted by selecting them and pressing Delete - deleted objects can be restored by pressing "u" git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5387 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
13
inst.c
13
inst.c
@@ -19,6 +19,7 @@
|
||||
#include "coord.h"
|
||||
#include "expr.h"
|
||||
#include "obj.h"
|
||||
#include "delete.h"
|
||||
#include "gui_status.h"
|
||||
#include "gui_tools.h"
|
||||
#include "gui_inst.h"
|
||||
@@ -740,12 +741,13 @@ static struct inst_ops frame_ops = {
|
||||
};
|
||||
|
||||
|
||||
void inst_begin_frame(const struct frame *frame, struct coord base,
|
||||
int active, int is_active_frame)
|
||||
void inst_begin_frame(struct obj *obj, const struct frame *frame,
|
||||
struct coord base, int active, int is_active_frame)
|
||||
{
|
||||
struct inst *inst;
|
||||
|
||||
inst = add_inst(&frame_ops, ip_frame, base);
|
||||
inst->obj = obj;
|
||||
inst->u.frame.ref = frame;
|
||||
inst->u.frame.active = is_active_frame;
|
||||
inst->active = active;
|
||||
@@ -865,6 +867,13 @@ void inst_hover(struct inst *inst, struct draw_ctx *ctx, int on)
|
||||
}
|
||||
|
||||
|
||||
int inst_delete(struct inst *inst)
|
||||
{
|
||||
return inst->ops == &vec_ops ?
|
||||
delete_vec(inst->vec) : delete_obj(inst->obj);
|
||||
}
|
||||
|
||||
|
||||
void inst_debug(void)
|
||||
{
|
||||
enum inst_prio prio;
|
||||
|
||||
Reference in New Issue
Block a user