From: Ton v. O. <tvo...@us...> - 2006-12-28 03:16:29
|
Update of /cvsroot/easycalc/easycalc In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv7432 Modified Files: graph.c grprefs.c grprefs.h Log Message: Increase size of colors array in graphPrefs to 9 to eliminate overlap with grEnable since there really are 9 colors (6 funs + axis + grid + background). Bumped PREF_GRAPH_VERSION since size of graphPrefs has changed since 1.24. Draw axes using the correct color (axis color was ignored before). Thanks to Jorge Gil for catching this. Index: grprefs.h =================================================================== RCS file: /cvsroot/easycalc/easycalc/grprefs.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** grprefs.h 10 Nov 2006 04:12:56 -0000 1.13 --- grprefs.h 28 Dec 2006 03:16:17 -0000 1.14 *************** *** 50,54 **** Boolean logx,logy; Int16 speed; ! IndexedColorType colors[8]; Boolean grEnable[9]; Int8 grType[6]; --- 50,54 ---- Boolean logx,logy; Int16 speed; ! IndexedColorType colors[9]; Boolean grEnable[9]; Int8 grType[6]; Index: graph.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/graph.c,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** graph.c 10 Nov 2006 04:12:56 -0000 1.54 --- graph.c 28 Dec 2006 03:16:16 -0000 1.55 *************** *** 487,492 **** graph_setcolor(-1); clie_eraserectangle(&natbounds,0); - graph_unsetcolor(); - if (graphPrefs.grEnable[6]) { /* axes drawing enabled */ /* y axis */ --- 487,490 ---- *************** *** 498,524 **** if (y>ScrPrefs.ymax && y<ScrPrefs.ymin) clie_drawline(ScrPrefs.xmin,y,ScrPrefs.xmax,y); ! /* draw axes labels */ ! if (graphPrefs.grEnable[8]) { /* axes labels enabled */ ! Coord dy1 = HanderaCoord(-11); ! Coord dy2 = HanderaCoord(-1); ! Coord dy3 = HanderaCoord(-10); ! Coord dy4 = HanderaCoord(-1); ! grtaps_print_val("ymin:",graphPrefs.ymin, ! stdbounds.topLeft.x + stdbounds.extent.x/2, ! stdbounds.topLeft.y + stdbounds.extent.y + dy1, ! align_center); ! grtaps_print_val("ymax:",graphPrefs.ymax, ! stdbounds.topLeft.x + stdbounds.extent.x/2, ! stdbounds.topLeft.y + dy2, align_center); ! grtaps_print_val("xmin:",graphPrefs.xmin, ! stdbounds.topLeft.x, ! stdbounds.topLeft.y + stdbounds.extent.y/2 + dy3, ! align_left); ! grtaps_print_val("xmax:",graphPrefs.xmax, ! stdbounds.topLeft.x + stdbounds.extent.x, ! stdbounds.topLeft.y + stdbounds.extent.y/2 + dy4, ! align_right); ! } } --- 496,524 ---- if (y>ScrPrefs.ymax && y<ScrPrefs.ymin) clie_drawline(ScrPrefs.xmin,y,ScrPrefs.xmax,y); ! } ! graph_unsetcolor(); ! /* Draw axes labels */ ! if (graphPrefs.grEnable[6] && graphPrefs.grEnable[8]) { /* axes and labels enabled */ ! Coord dy1 = HanderaCoord(-11); ! Coord dy2 = HanderaCoord(-1); ! Coord dy3 = HanderaCoord(-10); ! Coord dy4 = HanderaCoord(-1); ! ! grtaps_print_val("ymin:",graphPrefs.ymin, ! stdbounds.topLeft.x + stdbounds.extent.x/2, ! stdbounds.topLeft.y + stdbounds.extent.y + dy1, ! align_center); ! grtaps_print_val("ymax:",graphPrefs.ymax, ! stdbounds.topLeft.x + stdbounds.extent.x/2, ! stdbounds.topLeft.y + dy2, align_center); ! grtaps_print_val("xmin:",graphPrefs.xmin, ! stdbounds.topLeft.x, ! stdbounds.topLeft.y + stdbounds.extent.y/2 + dy3, ! align_left); ! grtaps_print_val("xmax:",graphPrefs.xmax, ! stdbounds.topLeft.x + stdbounds.extent.x, ! stdbounds.topLeft.y + stdbounds.extent.y/2 + dy4, ! align_right); } Index: grprefs.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/grprefs.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** grprefs.c 10 Nov 2006 04:12:56 -0000 1.26 --- grprefs.c 28 Dec 2006 03:16:17 -0000 1.27 *************** *** 116,120 **** graphPrefs.logy = false; graphPrefs.speed = 1; ! for (i=0; i<8; i++){ graphPrefs.grEnable[i] = true; if (colorDisplay) --- 116,123 ---- graphPrefs.logy = false; graphPrefs.speed = 1; ! for (i=0; i<9; i++){ ! /* Note: grEnable[8] enables axis labels, ! * colors[8] is the background color ! */ graphPrefs.grEnable[i] = true; if (colorDisplay) *************** *** 123,127 **** graphPrefs.colors[i] = funcolors[i]; } - graphPrefs.grEnable[8] = true; for (i=0; i<6; i++) graphPrefs.grType[i] = 1; --- 126,129 ---- |