From: Curt M. <we...@us...> - 2004-02-11 21:40:20
|
Update of /cvsroot/xastir/xastir/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3265 Modified Files: main.c Log Message: Fixing an annoying floating-point conversion bug in the Map Intensity menus. For 70% and 90%, they were reported as 60% and 80% in the menus. Index: main.c =================================================================== RCS file: /cvsroot/xastir/xastir/src/main.c,v retrieving revision 1.442 retrieving revision 1.443 diff -C2 -d -r1.442 -r1.443 *** main.c 6 Feb 2004 21:33:41 -0000 1.442 --- main.c 11 Feb 2004 21:35:50 -0000 1.443 *************** *** 5351,5354 **** --- 5351,5358 ---- NULL); XtSetSensitive(raster_intensity[(int)(raster_map_intensity * 10.0)],FALSE); + + //fprintf(stderr,"raster index = %d\n", + // (int)(raster_map_intensity * 10.01) ); + XtAddCallback(raster_intensity[0], XmNactivateCallback,Raster_intensity,"0.0"); XtAddCallback(raster_intensity[1], XmNactivateCallback,Raster_intensity,"0.1"); *************** *** 10735,10745 **** if(display_up){ for (i=0;i<11;i++){ ! if (i == (int)((float)(my_intensity * 10.0)) ) XtSetSensitive(raster_intensity[i],FALSE); else XtSetSensitive(raster_intensity[i],TRUE); } raster_map_intensity=my_intensity; // Set interrupt_drawing_now because conditions have changed. --- 10739,10752 ---- if(display_up){ for (i=0;i<11;i++){ ! if (i == (int)((float)(my_intensity * 10.01)) ) XtSetSensitive(raster_intensity[i],FALSE); else XtSetSensitive(raster_intensity[i],TRUE); + + //fprintf(stderr,"Change to index: %d\n", (int)((float)(my_intensity * 10.01))); } raster_map_intensity=my_intensity; + //fprintf(stderr,"raster_map_intensity = %f\n", raster_map_intensity); // Set interrupt_drawing_now because conditions have changed. |