Index: branches/eam_branches/ipp-20150405/Ohana/src/kapa2/src/DrawObjects.c
===================================================================
--- branches/eam_branches/ipp-20150405/Ohana/src/kapa2/src/DrawObjects.c	(revision 38098)
+++ branches/eam_branches/ipp-20150405/Ohana/src/kapa2/src/DrawObjects.c	(revision 38099)
@@ -248,5 +248,5 @@
   
   /* connect first point to second point */
-  sxa = sx0 - 0.5*(sx1 - sx0);
+  sxa = MIN (MAX (sx0 - 0.5*(sx1 - sx0), X0), X1);
   sya = MAX (sy0, Y0);
   DrawLine (sx0, sy0, sxa, sy0);
@@ -254,5 +254,5 @@
   
   /* draw segment equal distance behind first point and down to x-axis */
-  sxa = 0.5*(sx0 + sx1);
+  sxa = MIN (MAX (0.5*(sx0 + sx1), X0), X1);
   DrawLine (sx0, sy0, sxa, sy0);
   DrawLine (sxa, sy0, sxa, sy1);
@@ -269,5 +269,5 @@
     sx1 = MIN (MAX (sx1, X0), X1);
     sy1 = MAX (MIN (sy1, Y0), Y1);
-    sxa = 0.5*(sx0 + sx1);
+    sxa = MIN (MAX (0.5*(sx0 + sx1), X0), X1);
     DrawLine (sx0, sy0, sxa, sy0);
     DrawLine (sxa, sy0, sxa, sy1);
@@ -278,5 +278,5 @@
   
   /* draw segment equal distance after last point and down to x-axis */
-  sxa = sx1 + 0.5*(sx1 - sxo);
+  sxa = MIN (MAX (sx1 + 0.5*(sx1 - sxo), X0), X1);
   sya = MAX (sy1, Y0);
   DrawLine (sx1, sy1, sxa, sy1);
Index: branches/eam_branches/ipp-20150405/Ohana/src/kapa2/src/PSObjects.c
===================================================================
--- branches/eam_branches/ipp-20150405/Ohana/src/kapa2/src/PSObjects.c	(revision 38098)
+++ branches/eam_branches/ipp-20150405/Ohana/src/kapa2/src/PSObjects.c	(revision 38099)
@@ -211,5 +211,5 @@
   
   /* connect first point to second point */
-  sxa = sx0 - 0.5*(sx1 - sx0);
+  sxa = MIN (MAX (sx0 - 0.5*(sx1 - sx0), X0), X1);
   sya = MAX (sy0, Y0);
   DrawLine (sx0, sy0, sxa, sy0);
@@ -217,5 +217,5 @@
   
   /* draw segment equal distance behind first point and down to x-axis */
-  sxa = 0.5*(sx0 + sx1);
+  sxa = MIN (MAX (0.5*(sx0 + sx1), X0), X1);
   DrawLine (sx0, sy0, sxa, sy0);
   DrawLine (sxa, sy0, sxa, sy1);
@@ -232,5 +232,5 @@
     sx1 = MIN (MAX (sx1, X0), X1);
     sy1 = MAX (MIN (sy1, Y0), Y1);
-    sxa = 0.5*(sx0 + sx1);
+    sxa = MIN (MAX (0.5*(sx0 + sx1), X0), X1);
     DrawLine (sx0, sy0, sxa, sy0);
     DrawLine (sxa, sy0, sxa, sy1);
@@ -241,5 +241,5 @@
   
   /* draw segment equal distance after last point and down to x-axis */
-  sxa = sx1 + 0.5*(sx1 - sxo);
+  sxa = MIN (MAX (sx1 + 0.5*(sx1 - sxo), X0), X1);
   sya = MAX (sy1, Y0);
   DrawLine (sx1, sy1, sxa, sy1);
Index: branches/eam_branches/ipp-20150405/Ohana/src/kapa2/src/SetColormap.c
===================================================================
--- branches/eam_branches/ipp-20150405/Ohana/src/kapa2/src/SetColormap.c	(revision 38098)
+++ branches/eam_branches/ipp-20150405/Ohana/src/kapa2/src/SetColormap.c	(revision 38099)
@@ -166,4 +166,43 @@
     goto store_colors;
   }
+  /* anuenue */
+  if (!strcasecmp (name, "anuenue")) {
+    redRef   = 0.25*MaxValue*scale*4.0; // value at 0.0
+    greenRef = 0.50*MaxValue*scale*4.0;
+    blueRef  = 1.33*MaxValue*scale;
+    for (i = 0; i < (int)(0.50*MaxValue); i++) {  
+      SETVALUE (graphic[0].cmap[i].green, 0.0, 0, 0xffff); // red is a ramp from 0 to 0xffff
+      graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
+    }
+    for (i = (int)(0.50*MaxValue); i < (int)(0.75*MaxValue); i++) {  
+      SETVALUE (graphic[0].cmap[i].green, 4.0*i*scale - 0x20000, 0, 0xffff); // red is a ramp from 0 to 0xffff
+      graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
+    }
+    for (i = (int)(0.75*MaxValue); i < MaxValue; i++) {  
+      SETVALUE (graphic[0].cmap[i].green, 0xffff, 0, 0xffff); // red is a ramp from 0 to 0xffff
+      graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
+    }
+
+    for (i = 0; i < (int)(0.25*MaxValue); i++) {  
+      SETVALUE (graphic[0].cmap[i].red,  4*i*scale, 0, 0xffff);
+    }
+    for (i = (int)(0.25*MaxValue); i < (int)(0.50*MaxValue); i++) {  
+      SETVALUE (graphic[0].cmap[i].red,  0x20000 - 4*i*scale, 0, 0xffff);
+    }
+    for (i = (int)(0.50*MaxValue); i < MaxValue; i++) {  
+      SETVALUE (graphic[0].cmap[i].red,  2*i*scale - 0xffff, 0, 0xffff);
+    }
+
+    for (i = 0; i < (int)(0.50*MaxValue); i++) {  
+      SETVALUE (graphic[0].cmap[i].blue,  2*i*scale, 0, 0xffff);
+    }
+    for (i = (int)(0.50*MaxValue); i < (int)(0.75*MaxValue); i++) {  
+      SETVALUE (graphic[0].cmap[i].blue,  0x30000 - 4*i*scale, 0, 0xffff);
+    }
+    for (i = (int)(0.75*MaxValue); i < MaxValue; i++) {  
+      SETVALUE (graphic[0].cmap[i].blue,  4*i*scale - 0x30000, 0, 0xffff);
+    }
+    goto store_colors;
+  }
   return (FALSE);
 
Index: branches/eam_branches/ipp-20150405/Ohana/src/kapa2/src/bDrawObjects.c
===================================================================
--- branches/eam_branches/ipp-20150405/Ohana/src/kapa2/src/bDrawObjects.c	(revision 38098)
+++ branches/eam_branches/ipp-20150405/Ohana/src/kapa2/src/bDrawObjects.c	(revision 38099)
@@ -198,5 +198,5 @@
   
   /* connect first point to second point */
-  sxa = sx0 - 0.5*(sx1 - sx0);
+  sxa = MIN (MAX (sx0 - 0.5*(sx1 - sx0), X0), X1);
   sya = MAX (sy0, Y0);
   DrawLine (buffer, sx0, sy0, sxa, sy0);
@@ -204,5 +204,5 @@
   
   /* draw segment equal distance behind first point and down to x-axis */
-  sxa = 0.5*(sx0 + sx1);
+  sxa = MIN (MAX (0.5*(sx0 + sx1), X0), X1);
   DrawLine (buffer, sx0, sy0, sxa, sy0);
   DrawLine (buffer, sxa, sy0, sxa, sy1);
@@ -219,5 +219,5 @@
     sx1 = MIN (MAX (sx1, X0), X1);
     sy1 = MAX (MIN (sy1, Y0), Y1);
-    sxa = 0.5*(sx0 + sx1);
+    sxa = MIN (MAX (0.5*(sx0 + sx1), X0), X1);
     DrawLine (buffer, sx0, sy0, sxa, sy0);
     DrawLine (buffer, sxa, sy0, sxa, sy1);
@@ -228,5 +228,5 @@
   
   /* draw segment equal distance after last point and down to x-axis */
-  sxa = sx1 + 0.5*(sx1 - sxo);
+  sxa = MIN (MAX (sx1 + 0.5*(sx1 - sxo), X0), X1);
   sya = MAX (sy1, Y0);
   DrawLine (buffer, sx1, sy1, sxa, sy1);
