From b72ade0e78825dd97add4c7607c574df351abed0 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 4 Oct 2011 12:14:26 -0700 Subject: Change plot routine to take a drawing_area as argument Previously we passed in width and height and the routine itself decided to keep 5% margin around each edge - oddly doing this with double precision, even though this is all integer coordinates. Instead we are now passing in a drawing_area. We are kind of abusing the cairo_rectangle_int_t data type here - but it seemed silly to redefine a new data type for this. Width and height give the size of the TOTAL drawing area (as before). x and y give the offset from the edges - so the EFFECTIVE drawing area is width-2x and height-2y This is in preparation for adding tooltips - those need to know the coordinate offsets from the edges - so having this hard coded inside the plot function didn't make sense anymore. Signed-off-by: Dirk Hohndel --- display.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'display.h') diff --git a/display.h b/display.h index 9cd401a89..c441a7dd2 100644 --- a/display.h +++ b/display.h @@ -22,7 +22,7 @@ struct graphics_context { double topy, bottomy; }; -extern void plot(struct graphics_context *gc, int w, int h, struct dive *dive); +extern void plot(struct graphics_context *gc, cairo_rectangle_int_t *drawing_area, struct dive *dive); extern void set_source_rgb(struct graphics_context *gc, double r, double g, double b); #endif -- cgit v1.2.3-70-g09d2