[xiph-commits] r12240 - trunk/sushivision

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Mon Dec 25 14:01:48 PST 2006


Author: xiphmont
Date: 2006-12-25 14:01:46 -0800 (Mon, 25 Dec 2006)
New Revision: 12240

Modified:
   trunk/sushivision/plot.c
   trunk/sushivision/scale.c
   trunk/sushivision/scale.h
Log:
catch another inverted scale bug (can't zoom to box properly)



Modified: trunk/sushivision/plot.c
===================================================================
--- trunk/sushivision/plot.c	2006-12-25 21:13:31 UTC (rev 12239)
+++ trunk/sushivision/plot.c	2006-12-25 22:01:46 UTC (rev 12240)
@@ -979,11 +979,14 @@
 
 void plot_box_vals(Plot *p, double ret[4]){
   gdk_threads_enter();
-  ret[0] = (p->box_x1<p->box_x2?p->box_x1:p->box_x2);
-  ret[1] = (p->box_x1>p->box_x2?p->box_x1:p->box_x2);
+  int n = p->x.neg;
+  
+  ret[0] = (p->box_x1*n<p->box_x2*n?p->box_x1:p->box_x2);
+  ret[1] = (p->box_x1*n>p->box_x2*n?p->box_x1:p->box_x2);
 
-  ret[2] = (p->box_y1<p->box_y2?p->box_y1:p->box_y2);
-  ret[3] = (p->box_y1>p->box_y2?p->box_y1:p->box_y2);
+  n = p->y.neg;
+  ret[2] = (p->box_y1*n<p->box_y2*n?p->box_y1:p->box_y2);
+  ret[3] = (p->box_y1*n>p->box_y2*n?p->box_y1:p->box_y2);
   gdk_threads_leave();
 }
 

Modified: trunk/sushivision/scale.c
===================================================================
--- trunk/sushivision/scale.c	2006-12-25 21:13:31 UTC (rev 12239)
+++ trunk/sushivision/scale.c	2006-12-25 22:01:46 UTC (rev 12240)
@@ -312,6 +312,7 @@
   ret.first_val = first;
 
   ret.first_pixel = rint((first - (lowpoint / ret.m)) * ret.step_pixel / ret.step_val);
+  ret.neg = neg;
 
   return ret;
 }

Modified: trunk/sushivision/scale.h
===================================================================
--- trunk/sushivision/scale.h	2006-12-25 21:13:31 UTC (rev 12239)
+++ trunk/sushivision/scale.h	2006-12-25 22:01:46 UTC (rev 12240)
@@ -23,6 +23,7 @@
   char *legend;
   double lo;
   double hi;
+  int neg;
 
   long long first_val;
   long first_pixel;



More information about the commits mailing list