diff options
author | Salvador Cuñat <salvador.cunat@gmail.com> | 2013-02-02 16:23:15 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-02-03 06:56:45 +1100 |
commit | 8a49278740a68f4aba9d77492910b3d0136e8897 (patch) | |
tree | 8bba372e660bf52ae1b58baaafe79cbc9409666a /print.c | |
parent | 20d3b5f71495adccf59d27095445a0d2e63b6a09 (diff) | |
download | subsurface-8a49278740a68f4aba9d77492910b3d0136e8897.tar.gz |
Fix print displacement on SAC, CNS and OTUs
Changes in print_weight had displaced the plot of next prints.
This fix the displacement using cairo_save/restore.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'print.c')
-rw-r--r-- | print.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -487,17 +487,20 @@ static void show_dive_tanks(struct dive *dive, cairo_t *cr, double w, cairo_move_to (cr, w, 3 * line_height + (h * 0.05)); cairo_line_to (cr, 3 * line_width, 3 * line_height + (h * 0.05)); cairo_stroke (cr); + cairo_save (cr); + /* and print OTUs, CNS and weight */ cairo_translate (cr, (3.05 * line_width), height / (6 * (double) PANGO_SCALE)); print_weight_data (dive, cr, maxwidth * 0.90/2 , maxheight, maxheight / 2, font); - cairo_translate (cr, -(3.05 * line_width), -height / (6 * (double) PANGO_SCALE)); - cairo_translate (cr, w, 0); + cairo_restore (cr); + cairo_save(cr); + cairo_translate (cr, w, line_height/4); print_SAC (dive, cr, maxwidth * 0.90/2, maxheight, font); cairo_translate (cr, 0, line_height); print_cns (dive, cr, maxwidth * 0.90/2, maxheight, font); cairo_translate (cr,0, line_height); print_otus (dive, cr, maxwidth * 0.90/2, maxheight, font); - cairo_translate (cr, -w, -2 * line_height); + cairo_restore (cr); } } |