[PATCH] Align last temperature text end of temperature plot line

subsurface at henrik.synth.no subsurface at henrik.synth.no
Tue Feb 5 00:28:24 PST 2013


From: Henrik Brautaset Aronsen <subsurface at henrik.synth.no>

The temperature plot line was drawn to the end of the dive, but the last
temperature plot text was printed near the last temperature *sample*.

This was most visible on dives/test27.xml where two "20˚C" were
printed on top of each other at the start of the dive, while nothing
was printed at the end.

Signed-off-by: Henrik Brautaset Aronsen <subsurface at henrik.synth.no>
---
 profile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/profile.c b/profile.c
index 22a7498..86f7537 100644
--- a/profile.c
+++ b/profile.c
@@ -914,11 +914,11 @@ static void plot_temperature_text(struct graphics_context *gc, struct plot_info
 	for (i = 0; i < pi->nr; i++) {
 		struct plot_data *entry = pi->entry+i;
 		int mkelvin = entry->temperature;
+		sec = entry->sec;
 
 		if (!mkelvin)
 			continue;
 		last_temperature = mkelvin;
-		sec = entry->sec;
 		/* don't print a temperature
 		 * if it's been less than 5min and less than a 2K change OR
 		 * if it's been less than 2min OR if the change from the
-- 
1.7.11.5



More information about the subsurface mailing list