[xiph-commits] r18291 - trunk/spectrum
xiphmont at svn.xiph.org
xiphmont at svn.xiph.org
Thu May 17 05:21:43 PDT 2012
Author: xiphmont
Date: 2012-05-17 05:21:43 -0700 (Thu, 17 May 2012)
New Revision: 18291
Modified:
trunk/spectrum/spec_plot.c
trunk/spectrum/version.h
Log:
correct crash bug in clear_data
correct cosmetic autoscaling behavior when y is locked
Modified: trunk/spectrum/spec_plot.c
===================================================================
--- trunk/spectrum/spec_plot.c 2012-05-17 11:17:50 UTC (rev 18290)
+++ trunk/spectrum/spec_plot.c 2012-05-17 12:21:43 UTC (rev 18291)
@@ -1047,8 +1047,6 @@
p->ydata=data;
- if(!p->autoscale)return;
-
/* graph limit updates are conditional depending on mode/link */
pmax+=5;
pmin-=5;
@@ -1092,7 +1090,7 @@
if(p->ymaxtimer){
p->ymaxtimer--;
}else{
- p->ymax = (oldzero-PXDEL)*p->depth/(height-1);
+ ymax = (oldzero-PXDEL)*p->depth/(height-1);
}
}else{
p->ymaxtimer = TIMERFRAMES;
@@ -1127,21 +1125,24 @@
pmax+=10;
pmin-=10;
- if(p->mode == 0){
- if(ymax>p->ymax)p->ymax=ymax;
- if(pmax>p->pmax)p->pmax=pmax;
- if(pmin<p->pmin)p->pmin=pmin;
- }else{
- p->ymax=ymax;
- p->pmax=pmax;
- p->pmin=pmin;
+ p->disp_depth = p->depth;
+
+ if(p->autoscale){
+ if(p->mode == 0){
+ if(ymax>p->ymax)p->ymax=ymax;
+ if(pmax>p->pmax)p->pmax=pmax;
+ if(pmin<p->pmin)p->pmin=pmin;
+ }else{
+ p->ymax=ymax;
+ p->pmax=pmax;
+ p->pmin=pmin;
+ }
+
+ p->disp_ymax = p->ymax;
+ p->disp_pmax = p->pmax;
+ p->disp_pmin = p->pmin;
}
- p->disp_depth = p->depth;
- p->disp_ymax = p->ymax;
- p->disp_pmax = p->pmax;
- p->disp_pmin = p->pmin;
-
/* finally, align phase/response zeros on phase graphs */
if(p->disp_ymax>-p->ymax_limit){
if(p->link == LINK_PHASE){
@@ -1183,7 +1184,8 @@
void plot_clear (Plot *p){
GtkWidget *widget=GTK_WIDGET(p);
- int width=GTK_WIDGET(p)->allocation.width-p->padx;
+ int phase = (p->link == LINK_PHASE);
+ int width=GTK_WIDGET(p)->allocation.width-p->padx-(phase ? p->phax : 0);
int i,j;
if(p->ydata)
Modified: trunk/spectrum/version.h
===================================================================
--- trunk/spectrum/version.h 2012-05-17 11:17:50 UTC (rev 18290)
+++ trunk/spectrum/version.h 2012-05-17 12:21:43 UTC (rev 18291)
@@ -1,2 +1,2 @@
#define VERSION "$Id$ "
-/* DO NOT EDIT: Automated versioning hack [Thu May 17 07:11:05 EDT 2012] */
+/* DO NOT EDIT: Automated versioning hack [Thu May 17 08:16:16 EDT 2012] */
More information about the commits
mailing list