X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=profile.c;h=bc78ac3b4e42097be5d720fbfbe62f58a46faa8e;hb=0f9d1757a4590f554bcfc87f79c7a72baa5ad95d;hp=6f19902026e48bef55fcfec7c14b6e16cb759ce9;hpb=b72ade0e78825dd97add4c7607c574df351abed0;p=ext%2Fsubsurface.git diff --git a/profile.c b/profile.c index 6f19902..bc78ac3 100644 --- a/profile.c +++ b/profile.c @@ -160,6 +160,7 @@ static void plot_text(struct graphics_context *gc, const text_render_options_t * static void plot_one_event(struct graphics_context *gc, struct plot_info *pi, struct event *event, const text_render_options_t *tro) { int i, depth = 0; + int x,y; for (i = 0; i < pi->nr; i++) { struct plot_data *data = pi->entry + i; @@ -167,7 +168,23 @@ static void plot_one_event(struct graphics_context *gc, struct plot_info *pi, st break; depth = data->val; } - plot_text(gc, tro, event->time.seconds, depth, "%s", event->name); + /* draw a little tirangular marker and attach tooltip */ + x = SCALEX(gc, event->time.seconds); + y = SCALEY(gc, depth); + set_source_rgba(gc, 1.0, 1.0, 0.1, 0.8); + cairo_move_to(gc->cr, x-15, y+6); + cairo_line_to(gc->cr, x-3 , y+6); + cairo_line_to(gc->cr, x-9, y-6); + cairo_line_to(gc->cr, x-15, y+6); + cairo_stroke_preserve(gc->cr); + cairo_fill(gc->cr); + set_source_rgba(gc, 0.0, 0.0, 0.0, 0.8); + cairo_move_to(gc->cr, x-9, y-3); + cairo_line_to(gc->cr, x-9, y+1); + cairo_move_to(gc->cr, x-9, y+4); + cairo_line_to(gc->cr, x-9, y+4); + cairo_stroke(gc->cr); + attach_tooltip(x-15, y-6, 12, 12, event->name); } static void plot_events(struct graphics_context *gc, struct plot_info *pi, struct dive *dive)