[PATCH 1/2] Add dive computer name to the dive plot
Linus Torvalds
torvalds at linux-foundation.org
Thu Dec 6 11:10:22 PST 2012
From: Linus Torvalds <torvalds at linux-foundation.org>
Date: Thu, 6 Dec 2012 09:37:32 -0800
Subject: [PATCH 1/2] Add dive computer name to the dive plot
I want to have some way to show multiple dive computers, so start off by
adding the name of the current one. So if we change dive computers,
we'll see it.
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---
This is just a preliminary series of two patches that will make future
work a bit simpler.
Don't have too high expectations for now, neither of the patches does
anything interesting.
profile.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/profile.c b/profile.c
index b225f735706e..9fdc204f2793 100644
--- a/profile.c
+++ b/profile.c
@@ -2017,6 +2017,12 @@ void plot(struct graphics_context *gc, struct dive *dive, scale_mode_t scale)
cairo_close_path(gc->cr);
cairo_stroke(gc->cr);
+ /* Put the dive computer name in the lower left corner */
+ if (dc->model) {
+ static const text_render_options_t computer = {10, TIME_TEXT, LEFT, MIDDLE};
+ plot_text(gc, &computer, 0, 1, "%s", dc->model);
+ }
+
if (GRAPHS_ENABLED) {
plot_pp_gas_profile(gc, pi);
plot_pp_text(gc, pi);
--
1.8.0.dirty
More information about the subsurface
mailing list