diff options
author | Thomas White <taw@bitwiz.me.uk> | 2019-03-18 23:20:44 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.me.uk> | 2019-03-18 23:20:44 +0100 |
commit | 0734a2261ba45bccc012991d5f167fc073c138dd (patch) | |
tree | 7d5022a231fb6bbc24af1ec7fed15097c6195ad8 | |
parent | 04cf925a3116beb072c998b0cd3f105dedbab34e (diff) |
Show padding boundaries in editing box
-rw-r--r-- | libstorycode/gtk/gtkslideview.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libstorycode/gtk/gtkslideview.c b/libstorycode/gtk/gtkslideview.c index dd34535..8f4f120 100644 --- a/libstorycode/gtk/gtkslideview.c +++ b/libstorycode/gtk/gtkslideview.c @@ -119,13 +119,15 @@ static gint destroy_sig(GtkWidget *window, GtkSlideView *e) static void draw_editing_box(cairo_t *cr, struct slide_item *item, + Stylesheet *stylesheet, double slide_w, double slide_h, double xmin, double ymin, double width, double height) { const double dash[] = {2.0, 2.0}; double ptot_w, ptot_h; double pad_l, pad_r, pad_t, pad_b; - pad_l = 0.0; pad_r = 0.0; pad_t = 0.0; pad_b = 0.0; /* FIXME */ + slide_item_get_padding(item, stylesheet, &pad_l, &pad_r, &pad_t, &pad_b, + slide_w, slide_h); cairo_new_path(cr); cairo_rectangle(cr, xmin, ymin, width, height); @@ -138,8 +140,8 @@ static void draw_editing_box(cairo_t *cr, struct slide_item *item, ptot_h = pad_t + pad_b; cairo_rectangle(cr, xmin+pad_l, ymin+pad_t, width-ptot_w, height-ptot_h); cairo_set_dash(cr, dash, 2, 0.0); - cairo_set_source_rgb(cr, 0.0, 0.0, 0.0); - cairo_set_line_width(cr, 0.1); + cairo_set_source_rgba(cr, 0.8, 0.8, 1.0, 0.5); + cairo_set_line_width(cr, 1.0); cairo_stroke(cr); cairo_set_dash(cr, NULL, 0, 0.0); @@ -252,7 +254,8 @@ static void draw_overlay(cairo_t *cr, GtkSlideView *e) slide_get_logical_size(e->slide, stylesheet, &slide_w, &slide_h); slide_item_get_geom(e->cursor_frame, stylesheet, &x, &y, &w, &h, slide_w, slide_h); - draw_editing_box(cr, e->cursor_frame, x, y, w, h); + draw_editing_box(cr, e->cursor_frame, stylesheet, slide_w, slide_h, + x, y, w, h); if ( e->cursor_frame->resizable ) { /* Draw resize handles */ |