summaryrefslogtreecommitdiffstats
path: root/profile.h
diff options
context:
space:
mode:
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)