aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-07-15 14:43:13 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:53 +0100
commit39d99aa9bb047cbce4d89941830cb5b0fc31495e (patch)
treeaf300ac42618caedbdd6d2594669c99d9e7a0272
parent0ee51508cd841ae3a4cca6ce416fbe9922abf009 (diff)
Fix arithmetic problem with colour scale
-rw-r--r--src/render.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/render.c b/src/render.c
index 606f090a..7f793797 100644
--- a/src/render.c
+++ b/src/render.c
@@ -108,10 +108,10 @@ static void render_rgb(float val, float max, float *rp, float *gp, float *bp)
float r, g, b;
s = val / (max/6);
- p = fmod(val, max/6);
- p /= (max/6);
+ p = fmod(val, max/6.0);
+ p /= (max/6.0);
- r = 0; g = 0; b = 0;
+ r = 0.0; g = 0.0; b = 0.0;
if ( (val < 0.0) ) {
s = 0;