diff options
author | Thomas White <taw@physics.org> | 2011-10-05 18:01:36 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2011-10-05 18:01:36 +0200 |
commit | c89e22542ffd440e646b9217c963ca98c5c7a5ad (patch) | |
tree | e78b5445690cc1e348b7e4ac7de9b8b6d4395837 /src/tool_text.c | |
parent | 48cbffa2da42612a242f96fa0fd09683e9d1442b (diff) |
Redraw and drag logic
Diffstat (limited to 'src/tool_text.c')
-rw-r--r-- | src/tool_text.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tool_text.c b/src/tool_text.c index c5555b6..6a5c8a1 100644 --- a/src/tool_text.c +++ b/src/tool_text.c @@ -269,12 +269,14 @@ void move_cursor(struct object *op, int dir) void move_cursor_left(struct object *op) { move_cursor(op, -1); + redraw_overlay(op->parent->parent); } void move_cursor_right(struct object *op) { move_cursor(op, +1); + redraw_overlay(op->parent->parent); } @@ -298,6 +300,8 @@ void handle_text_backspace(struct object *op) update_text(o); o->base.parent->object_seq++; + + redraw_overlay(op->parent->parent); } @@ -353,6 +357,13 @@ static void draw_caret(cairo_t *cr, struct object *op) } +static void update_text_object(struct object *op) +{ + struct text_object *o = (struct text_object *)op; + update_text(o); +} + + static void delete_text_object(struct object *op) { struct text_object *o = (struct text_object *)op; @@ -392,6 +403,7 @@ static struct object *add_text_object(struct slide *s, double x, double y, /* Methods for this object */ new->base.render_object = render_text_object; new->base.delete_object = delete_text_object; + new->base.update_object = update_text_object; if ( add_object_to_slide(s, (struct object *)new) ) { delete_object((struct object *)new); |