]> git.tdb.fi Git - ext/subsurface.git/blobdiff - profile.c
Move depth/time grid back
[ext/subsurface.git] / profile.c
index 247a9c487cd9af314177c1c7a1ec2e804e75c3cf..716ce1047119f776a0269b64ce25a1eb6f4e9e68 100644 (file)
--- a/profile.c
+++ b/profile.c
@@ -622,12 +622,16 @@ static void set_sac_color(struct graphics_context *gc, int sac, int avg_sac)
        int sac_index = 0;
        int delta = sac - avg_sac + 7000;
 
-       sac_index = delta / 2000;
-       if (sac_index < 0)
-               sac_index = 0;
-       if (sac_index > SAC_COLORS - 1)
-               sac_index = SAC_COLORS - 1;
-       set_source_rgb_struct(gc, &sac_color[sac_index]);
+       if (!gc->printer) {
+               sac_index = delta / 2000;
+               if (sac_index < 0)
+                       sac_index = 0;
+               if (sac_index > SAC_COLORS - 1)
+                       sac_index = SAC_COLORS - 1;
+               set_source_rgb_struct(gc, &sac_color[sac_index]);
+       } else {
+               set_source_rgb(gc, 1.0, 1.0, 1.0);
+       }
 }
 
 /* calculate the current SAC in ml/min and convert to int */
@@ -1330,13 +1334,13 @@ void plot(struct graphics_context *gc, cairo_rectangle_int_t *drawing_area, stru
        gc->maxx = (drawing_area->width - 2*drawing_area->x);
        gc->maxy = (drawing_area->height - 2*drawing_area->y);
 
-       /* Temperature profile */
-       plot_temperature_profile(gc, pi);
-
        /* Depth profile */
        plot_depth_profile(gc, pi);
        plot_events(gc, pi, dive);
 
+       /* Temperature profile */
+       plot_temperature_profile(gc, pi);
+
        /* Cylinder pressure plot */
        plot_cylinder_pressure(gc, pi, dive);