summaryrefslogtreecommitdiffstats
path: root/profile.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-08 14:56:06 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-08 15:01:49 -0700
commit6f06c31d0b9db9ffae45d409557864469ab169b0 (patch)
treed4197bd97aee1fbd6c752d8b6667c99db4786707 /profile.h
parent688276b6f200c5d8b44ab5b6092265a93f7c0b41 (diff)
downloadsubsurface-6f06c31d0b9db9ffae45d409557864469ab169b0.tar.gz
Stop passing around gc and pi
Make the graphics_context part of the ProfileGraphicsView and remember that the plot info is already a part of the graphics_context (we kept passing around both of them in the Gtk code... pointless but a leftover from before adding the pi to the gc...) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.h')
-rw-r--r--profile.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/profile.h b/profile.h
index 62affe04e..13e417785 100644
--- a/profile.h
+++ b/profile.h
@@ -84,6 +84,10 @@ int get_maxdepth(struct plot_info *pi);
#define MIDDLE (0)
#define BOTTOM (-1)
+#define SCALEXGC(x) (((x) - gc.leftx) / (gc.rightx - gc.leftx) * gc.maxx)
+#define SCALEYGC(y) (((y) - gc.topy) / (gc.bottomy - gc.topy) * gc.maxy)
+#define SCALEGC(x,y) SCALEXGC(x),SCALEYGC(y)
+
#define SCALEX(gc,x) (((x)-gc->leftx)/(gc->rightx-gc->leftx)*gc->maxx)
#define SCALEY(gc,y) (((y)-gc->topy)/(gc->bottomy-gc->topy)*gc->maxy)
#define SCALE(gc,x,y) SCALEX(gc,x),SCALEY(gc,y)