Common subdirectories: /tmp/xfig.3.2.4/Doc and xfig.3.2.4/Doc Common subdirectories: /tmp/xfig.3.2.4/Libraries and xfig.3.2.4/Libraries Only in xfig.3.2.4/: Makefile Only in xfig.3.2.4/: Makefile.bak diff -w -x '*.o' -u /tmp/xfig.3.2.4/mode.c xfig.3.2.4/mode.c --- /tmp/xfig.3.2.4/mode.c 2002-12-16 20:30:52.000000000 +0100 +++ xfig.3.2.4/mode.c 2003-01-29 13:34:00.000000000 +0100 @@ -34,16 +34,19 @@ int autoforwardarrow_mode = 0; int autobackwardarrow_mode = 0; int cur_gridmode, cur_gridunit, grid_unit; -int cur_pointposn; -int posn_rnd[NUM_GRID_UNITS][P_GRID4 + 1] = { - { 0, PPCM/10, PPCM/5, PPCM/2, PPCM, PPCM*2}, /* mm mode */ - { 0, PPI/16, PPI/8, PPI/4, PPI/2, PPI}, /* 1/16" mode */ - { 0, PPI/20, PPI/10, PPI/5, PPI/2, PPI}, /* 1/10" mode */ - }; -int posn_hlf[NUM_GRID_UNITS][P_GRID4 + 1] = { - { 0, PPCM/20, PPCM/10, PPCM/4, PPCM/2, PPCM}, - { 0, PPI/32, PPI/16, PPI/8, PPI/4, PPI/2}, - { 0, PPI/40, PPI/20, PPI/10, PPI/5, PPI/2}, +int cur_pointposn = P_ANY; +float cur_user_pointposn = DEF_POINTPOSN; +int posn_base[NUM_GRID_UNITS] = {PPCM, PPI, PPI}; +char* posn_basename[NUM_GRID_UNITS] = {"cm", "inch", "inch"}; +float posn_rnd[NUM_GRID_UNITS][P_GRID4 + 1] = { + { 0, PPCM, PPCM/10, PPCM/5, PPCM/2, PPCM, PPCM*2}, /* mm mode */ + { 0, PPI, PPI/16, PPI/8, PPI/4, PPI/2, PPI}, /* 1/16" mode */ + { 0, PPI, PPI/20, PPI/10, PPI/5, PPI/2, PPI}, /* 1/10" mode */ +}; +float posn_hlf[NUM_GRID_UNITS][P_GRID4 + 1] = { + { 0, PPCM, PPCM/25, PPCM/10, PPCM/4, PPCM/2, PPCM}, + { 0, PPI, PPI/32, PPI/16, PPI/8, PPI/4, PPI/2}, + { 0, PPI, PPI/40, PPI/20, PPI/10, PPI/5, PPI/2}, }; int grid_coarse[NUM_GRID_UNITS][GRID_4] = { { PPCM/5, PPCM/2, PPCM, PPCM*2}, /* 2mm, 5mm, 10mm, 20mm */ diff -w -x '*.o' -u /tmp/xfig.3.2.4/mode.h xfig.3.2.4/mode.h --- /tmp/xfig.3.2.4/mode.h 2002-12-16 20:29:18.000000000 +0100 +++ xfig.3.2.4/mode.h 2003-01-29 13:34:01.000000000 +0100 @@ -128,15 +128,19 @@ /* point position */ #define P_ANY 0 -#define P_MAGNET 1 -#define P_GRID1 2 -#define P_GRID2 3 -#define P_GRID3 4 -#define P_GRID4 5 +#define P_USER 1 +#define P_MAGNET 2 +#define P_GRID1 3 +#define P_GRID2 4 +#define P_GRID3 5 +#define P_GRID4 6 extern int cur_pointposn; -extern int posn_rnd[NUM_GRID_UNITS][P_GRID4+1]; -extern int posn_hlf[NUM_GRID_UNITS][P_GRID4+1]; +extern float cur_user_pointposn; +extern int posn_base[NUM_GRID_UNITS]; +extern char* posn_basename[NUM_GRID_UNITS]; +extern float posn_rnd[NUM_GRID_UNITS][P_GRID4+1]; +extern float posn_hlf[NUM_GRID_UNITS][P_GRID4+1]; /* rotn axis */ #define UD_FLIP 1 diff -w -x '*.o' -u /tmp/xfig.3.2.4/object.h xfig.3.2.4/object.h --- /tmp/xfig.3.2.4/object.h 2002-11-19 23:29:14.000000000 +0100 +++ xfig.3.2.4/object.h 2003-01-24 13:11:46.000000000 +0100 @@ -428,6 +428,9 @@ #define O_ELLIPSE 1 #define O_POLYLINE 2 #define O_SPLINE 3 +#ifdef O_TEXT +#undef O_TEXT +#endif #define O_TEXT 4 #define O_ARC 5 #define O_COMPOUND 6 diff -w -x '*.o' -u /tmp/xfig.3.2.4/resources.h xfig.3.2.4/resources.h --- /tmp/xfig.3.2.4/resources.h 2002-09-19 23:23:48.000000000 +0200 +++ xfig.3.2.4/resources.h 2003-01-29 19:15:50.000000000 +0100 @@ -40,6 +40,12 @@ #define MIN_DEPTH 0 #define MAX_DEPTH 999 +/* starting, min, max user point positioning */ +#define DEF_POINTPOSN 0.125 +#define MIN_POINTPOSN 0.0 +#define MAX_POINTPOSN 1000.0 +#define INC_POINTPOSN 0.125 + /* min, max font size (points) */ #define MIN_FONT_SIZE 1 #define MAX_FONT_SIZE 500 Only in xfig.3.2.4/: test.fig Only in xfig.3.2.4/: test.xbm diff -w -x '*.o' -u /tmp/xfig.3.2.4/u_bound.c xfig.3.2.4/u_bound.c --- /tmp/xfig.3.2.4/u_bound.c 2002-10-18 20:48:31.000000000 +0200 +++ xfig.3.2.4/u_bound.c 2003-01-29 18:37:26.000000000 +0100 @@ -713,8 +713,14 @@ if (x < 0) return -ceil_coords(-x); - tmp_t = x % posn_rnd[cur_gridunit][cur_pointposn]; + if (cur_pointposn == P_USER) { + float g = posn_rnd[cur_gridunit][cur_pointposn]; + x -= x - (floor(x / g) * g); + } + else { + tmp_t = x % ((int)posn_rnd[cur_gridunit][cur_pointposn]); x = x - tmp_t; + } return x; } @@ -733,8 +739,16 @@ return -floor_coords(-x); x = x + posn_rnd[cur_gridunit][cur_pointposn]-1; - tmp_t = x%posn_rnd[cur_gridunit][cur_pointposn]; + + if (cur_pointposn == P_USER) { + float g = posn_rnd[cur_gridunit][cur_pointposn]; + x -= x - (floor(x / g) * g); + } + else { + tmp_t = x % ((int) posn_rnd[cur_gridunit][cur_pointposn]); x = x - tmp_t; + } + return x; } diff -w -x '*.o' -u /tmp/xfig.3.2.4/w_canvas.c xfig.3.2.4/w_canvas.c --- /tmp/xfig.3.2.4/w_canvas.c 2002-11-07 20:50:35.000000000 +0100 +++ xfig.3.2.4/w_canvas.c 2003-01-29 19:20:21.000000000 +0100 @@ -225,7 +225,7 @@ Window rw, cw; int rx, ry, cx, cy; unsigned int mask; - register int x, y; + int x, y; static char compose_buf[2]; @@ -932,3 +932,41 @@ XtPopup(panel, XtGrabNone); active_mode_panel = panel; } + +#define DEBUG + +void round_coords_precise(int *x, int *y) +{ + float g = posn_rnd[cur_gridunit][cur_pointposn]; + float h = posn_hlf[cur_gridunit][cur_pointposn]; + float dx, dy; + +#ifdef DEBUG + printf("x=%d y=%d", *x, *y); + printf(" g=%f h=%f x-floor=%f y-floor=%f", + g, h, floor(*x / g), (floor(*y / g))); +#endif + + if (x < 0) { + dx = -*x - floor(-*x / g) * g; + *x = (dx < h)? *x + dx : *x - g + dx; + } + else { + dx = *x - floor(*x / g) * g; + *x = (dx < h)? *x - dx : *x + g - dx; + } + + if (y < 0) { + dy = -*y - floor(-*y / g) * g; + *y = (dy < h)? *y + dy : *y - g + dy; + } + else { + dy = *y - floor(*y / g) * g; + *y = (dy < h)? *y - dy : *y + g - dy; + } +#ifdef DEBUG + printf(" dx=%f dy=%f", dx, dy); + printf("\trnd_x=%d rnd_y=%d\n", *x, *y); +#endif +} + diff -w -x '*.o' -u /tmp/xfig.3.2.4/w_canvas.h xfig.3.2.4/w_canvas.h --- /tmp/xfig.3.2.4/w_canvas.h 2002-03-27 01:43:33.000000000 +0100 +++ xfig.3.2.4/w_canvas.h 2003-01-29 18:27:11.000000000 +0100 @@ -54,22 +54,25 @@ #define LOC_OBJ "Locate Object" /* macro which rounds coordinates depending on point positioning mode */ +void round_coords_precise(int *x, int *y); + #define round_coords(x, y) \ if (cur_pointposn != P_ANY) \ - if (!anypointposn) { \ + if (cur_pointposn == P_USER) round_coords_precise(&x, &y); \ + else if (!anypointposn) { \ int _txx; \ if (x<0) \ - x = ((_txx = abs(x)%posn_rnd[cur_gridunit][cur_pointposn]) < posn_hlf[cur_gridunit][cur_pointposn]) \ - ? x + _txx : x - posn_rnd[cur_gridunit][cur_pointposn] + _txx; \ + x = ((_txx = abs(x)%((int) posn_rnd[cur_gridunit][cur_pointposn])) < posn_hlf[cur_gridunit][cur_pointposn]) \ + ? x + _txx : x - ((int) posn_rnd[cur_gridunit][cur_pointposn]) + _txx; \ else \ - x = ((_txx = x%posn_rnd[cur_gridunit][cur_pointposn]) < posn_hlf[cur_gridunit][cur_pointposn]) \ - ? x - _txx : x + posn_rnd[cur_gridunit][cur_pointposn] - _txx; \ + x = ((_txx = x%((int) posn_rnd[cur_gridunit][cur_pointposn])) < posn_hlf[cur_gridunit][cur_pointposn]) \ + ? x - _txx : x + ((int) posn_rnd[cur_gridunit][cur_pointposn]) - _txx; \ if (y<0) \ - y = ((_txx = abs(y)%posn_rnd[cur_gridunit][cur_pointposn]) < posn_hlf[cur_gridunit][cur_pointposn]) \ - ? y + _txx : y - posn_rnd[cur_gridunit][cur_pointposn] + _txx; \ + y = ((_txx = abs(y)%((int) posn_rnd[cur_gridunit][cur_pointposn])) < posn_hlf[cur_gridunit][cur_pointposn]) \ + ? y + _txx : y - ((int) posn_rnd[cur_gridunit][cur_pointposn]) + _txx; \ else \ - y = ((_txx = y%posn_rnd[cur_gridunit][cur_pointposn]) < posn_hlf[cur_gridunit][cur_pointposn]) \ - ? y - _txx : y + posn_rnd[cur_gridunit][cur_pointposn] - _txx; \ + y = ((_txx = y%((int) posn_rnd[cur_gridunit][cur_pointposn])) < posn_hlf[cur_gridunit][cur_pointposn]) \ + ? y - _txx : y + ((int) posn_rnd[cur_gridunit][cur_pointposn]) - _txx; \ } #endif /* W_CANVAS_H */ diff -w -x '*.o' -u /tmp/xfig.3.2.4/w_icons.c xfig.3.2.4/w_icons.c --- /tmp/xfig.3.2.4/w_icons.c 2002-11-09 00:30:53.000000000 +0100 +++ xfig.3.2.4/w_icons.c 2003-01-24 21:20:26.000000000 +0100 @@ -1478,6 +1478,23 @@ /* fine grid (only used for point positioning) */ +#define user_grid_width 32 +#define user_grid_height 32 +static unsigned char user_grid_bits[]={ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x0e,0x00,0x00, +0x40,0x04,0x00,0x00,0x40,0x04,0x00,0x00,0x40,0xc4,0x39,0x0d, +0x40,0x24,0x44,0x03,0x40,0xc4,0x7c,0x01,0x40,0x04,0x05,0x01, +0x40,0x04,0x05,0x01,0x80,0xe3,0x38,0x01,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0xf0,0x01,0x00,0x00,0x20,0x02,0x08,0x00,0x20,0x02,0x04, +0x00,0x20,0x72,0x0e,0x00,0x20,0x8a,0x04,0x00,0x20,0xfa,0x04, +0x00,0x20,0x0a,0x04,0x00,0x20,0x0a,0x04,0x00,0xf0,0x71,0x04, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; + +/* fine grid (only used for point positioning) */ + #define fine_grid_width 32 #define fine_grid_height 32 static unsigned char fine_grid_bits[]={ @@ -2141,6 +2158,8 @@ (char*)grid4_bits }; icon_struct fine_grid_ic = { fine_grid_width, fine_grid_height, (char*)fine_grid_bits }; +icon_struct user_grid_ic = { user_grid_width, user_grid_height, + (char*)user_grid_bits }; icon_struct unconstrained_ic = { unconstrained_width, unconstrained_height, (char*)unconstrained_bits }; icon_struct latexline_ic = { latexline_width, latexline_height, diff -w -x '*.o' -u /tmp/xfig.3.2.4/w_icons.h xfig.3.2.4/w_icons.h --- /tmp/xfig.3.2.4/w_icons.h 2002-03-27 01:44:26.000000000 +0100 +++ xfig.3.2.4/w_icons.h 2003-01-24 13:14:10.000000000 +0100 @@ -77,6 +77,7 @@ extern icon_struct c_intspl_ic; extern icon_struct line_ic; extern icon_struct fine_grid_ic; +extern icon_struct user_grid_ic; extern icon_struct unconstrained_ic; extern icon_struct latexline_ic; extern icon_struct latexarrow_ic; diff -w -x '*.o' -u /tmp/xfig.3.2.4/w_indpanel.c xfig.3.2.4/w_indpanel.c --- /tmp/xfig.3.2.4/w_indpanel.c 2002-10-19 01:05:41.000000000 +0200 +++ xfig.3.2.4/w_indpanel.c 2003-01-26 23:59:45.000000000 +0100 @@ -128,6 +128,7 @@ static void show_linestyle(), show_joinstyle(), show_capstyle(); static void show_anglegeom(), show_arctype(); static void show_pointposn(), show_gridmode(), show_linkmode(); +static void inc_pointposn(), dec_pointposn(); static void show_linewidth(), inc_linewidth(), dec_linewidth(); static void show_boxradius(), inc_boxradius(), dec_boxradius(); static void show_font(), inc_font(), dec_font(); @@ -206,6 +207,7 @@ static choice_info pointposn_choices[] = { {P_ANY, &any_ic,}, + {P_USER, &user_grid_ic,}, {P_MAGNET, &fine_grid_ic,}, {P_GRID1, &grid1_ic,}, {P_GRID2, &grid2_ic,}, @@ -1124,6 +1126,7 @@ static Widget nval_popup, form, cancel, apply, set; static Widget beside, below, newvalue, label; static Widget dash_length, dot_gap; +static Widget user_pointposn; static ind_sw_info *nval_i; /* handle arrow sizes settings */ @@ -1370,9 +1373,9 @@ /* make arrow thickness label and entries */ /* make a spinner entry widget for abs values */ - sprintf(buf,"%.1f",cur_arrowthick); + sprintf(buf,"%.3f",cur_arrowthick); a_t_spin = beside = MakeFloatSpinnerEntry(form, &arrow_thick_w, "arrow_thickness", - abslabel, (Widget) NULL, (XtCallbackProc) 0, buf, 0.1, 10000.0, 1.0, 40); + abslabel, (Widget) NULL, (XtCallbackProc) 0, buf, 0.1, 10000.0, 1.0, 55); FirstArg(XtNfromHoriz, beside); NextArg(XtNfromVert, abslabel); @@ -1384,9 +1387,9 @@ beside = XtCreateManagedWidget(" Thickness ", labelWidgetClass, form, Args, ArgCount); /* make a spinner for Thickness = Multiple of line width */ - sprintf(buf,"%.1f",cur_arrow_multthick); + sprintf(buf,"%.3f",cur_arrow_multthick); m_t_spin = below = MakeFloatSpinnerEntry(form, &arrow_mult_thick_w, "arrow_mult_thickness", - abslabel, beside, (XtCallbackProc) 0, buf, 0.1, 10000.0, 1.0, 40); + abslabel, beside, (XtCallbackProc) 0, buf, 0.1, 10000.0, 1.0, 55); /* save the "normal" background so we can switch between that and gray (insensitive) */ FirstArg(XtNbackground, &arrow_size_bg); @@ -1396,9 +1399,9 @@ /* make arrow width label and entries */ /* make a spinner entry widget for abs values */ - sprintf(buf,"%.1f",cur_arrowwidth); + sprintf(buf,"%.3f",cur_arrowwidth); a_w_spin = beside = MakeFloatSpinnerEntry(form, &arrow_width_w, "arrow_width", - below, (Widget) NULL, (XtCallbackProc) 0, buf, 0.1, 10000.0, 1.0, 40); + below, (Widget) NULL, (XtCallbackProc) 0, buf, 0.1, 10000.0, 1.0, 55); FirstArg(XtNfromHoriz, beside); NextArg(XtNfromVert, below); @@ -1410,16 +1413,16 @@ beside = XtCreateManagedWidget(" Width ", labelWidgetClass, form, Args, ArgCount); /* make a spinner for Width = Multiple of line width */ - sprintf(buf,"%.1f",cur_arrow_multwidth); + sprintf(buf,"%.3f",cur_arrow_multwidth); m_w_spin = below = MakeFloatSpinnerEntry(form, &arrow_mult_width_w, "arrow_mult_width", - below, beside, (XtCallbackProc) 0, buf, 0.1, 10000.0, 1.0, 40); + below, beside, (XtCallbackProc) 0, buf, 0.1, 10000.0, 1.0, 55); /* make arrow length label and entries */ /* make a spinner entry widget for abs values */ - sprintf(buf,"%.1f",cur_arrowheight); + sprintf(buf,"%.3f",cur_arrowheight); a_h_spin = beside = MakeFloatSpinnerEntry(form, &arrow_height_w, "arrow_height", - below, (Widget) NULL, (XtCallbackProc) 0, buf, 0.1, 10000.0, 1.0, 40); + below, (Widget) NULL, (XtCallbackProc) 0, buf, 0.1, 10000.0, 1.0, 55); FirstArg(XtNfromHoriz, beside); NextArg(XtNfromVert, below); @@ -1431,9 +1434,9 @@ beside = XtCreateManagedWidget(" Height ", labelWidgetClass, form, Args, ArgCount); /* make a spinner for Height = Multiple of line width */ - sprintf(buf,"%.1f",cur_arrow_multheight); + sprintf(buf,"%.3f",cur_arrow_multheight); m_h_spin = below = MakeFloatSpinnerEntry(form, &arrow_mult_height_w, "arrow_mult_height", - below, beside, (XtCallbackProc) 0, buf, 0.1, 10000.0, 1.0, 40); + below, beside, (XtCallbackProc) 0, buf, 0.1, 10000.0, 1.0, 55); /* make spinners sensitive or insensitive */ XtSetSensitive(a_t_spin, use_abs_arrowvals); @@ -1514,7 +1517,6 @@ XButtonEvent *ev; { (*choice_i->i_varadr) = sel_choice->value; - show_action(choice_i); /* auxiliary info */ switch (choice_i->func) { @@ -1535,10 +1537,25 @@ cur_styleval=cur_dashlength; else if(cur_linestyle==DOTTED_LINE) cur_styleval=cur_dotgap; - + break; + case I_POINTPOSN: + cur_user_pointposn = atof(panel_get_value(user_pointposn)); + if(cur_user_pointposn < 0.0) cur_user_pointposn = 1.0; + posn_rnd[cur_gridunit][P_USER] = + posn_base[cur_gridunit] * cur_user_pointposn; + posn_hlf[cur_gridunit][P_USER] = + posn_rnd[cur_gridunit][P_USER] / 2; + printf("%d %f %f %f\n", + posn_base[cur_gridunit], + cur_user_pointposn, + posn_base[cur_gridunit] * cur_user_pointposn - + posn_rnd[cur_gridunit][P_USER], + posn_rnd[cur_gridunit][P_USER] / 2 - + posn_hlf[cur_gridunit][P_USER]); break; } + show_action(choice_i); choice_panel_dismiss(); } @@ -1576,12 +1593,17 @@ XtSetSensitive(delunusedColors, False); } else if (isw->func == I_LINESTYLE) { /* update current dash length/dot gap indicators */ - sprintf(buf, "%.1f", cur_dashlength); + sprintf(buf, "%.3f", cur_dashlength); FirstArg(XtNstring, buf); SetValues(dash_length); - sprintf(buf, "%.1f", cur_dotgap); + sprintf(buf, "%.3f", cur_dotgap); FirstArg(XtNstring, buf); SetValues(dot_gap); + } else if (isw->func == I_POINTPOSN) { + /* update current dash length/dot gap indicators */ + sprintf(buf, "%.3f", cur_user_pointposn); + FirstArg(XtNstring, buf); + SetValues(user_pointposn); } if (appres.DEBUG) XtPopup(choice_popup, XtGrabNone); /* makes debugging easier */ @@ -1734,13 +1756,39 @@ form, Args, ArgCount); obeside = beside; XtAddEventHandler(beside, ButtonReleaseMask, False, - (XtEventHandler) choice_panel_set, (XtPointer) tmp_choice); + (XtEventHandler) choice_panel_set, + (XtPointer) tmp_choice); count++; } below = beside; /* auxiliary info */ switch (isw->func) { + case I_POINTPOSN: + FirstArg(XtNfromVert, beside); + NextArg(XtNborderWidth, 0); + NextArg(XtNlabel, "User point positioning"); + NextArg(XtNtop, XtChainTop); + NextArg(XtNbottom, XtChainTop); + NextArg(XtNleft, XtChainLeft); + NextArg(XtNright, XtChainLeft); + label = XtCreateManagedWidget("user_pointposn", + labelWidgetClass, form, + Args, ArgCount); + + sprintf(buf, "%2.3f", cur_user_pointposn); + below = MakeFloatSpinnerEntry(form, &user_pointposn, + "user_pointposn", beside, label, + (XtCallbackProc) 0, buf, + MIN_POINTPOSN, MAX_POINTPOSN, + INC_POINTPOSN, + 65); + + /* enable mousefun kbd icon */ + XtAugmentTranslations(user_pointposn, + XtParseTranslationTable(kbd_translations)); + + break; case I_LINESTYLE: /* dash length */ FirstArg(XtNfromVert, beside); @@ -1753,9 +1801,9 @@ label = XtCreateManagedWidget("default_dash_length", labelWidgetClass, form, Args, ArgCount); - sprintf(buf, "%.1f", cur_dashlength); + sprintf(buf, "%.3f", cur_dashlength); below = MakeFloatSpinnerEntry(form, &dash_length, "dash_length", beside, label, - (XtCallbackProc) 0, buf, 0.0, 10000.0, 1.0, 40); + (XtCallbackProc) 0, buf, 0.0, 10000.0, 1.0, 55); /* enable mousefun kbd icon */ XtAugmentTranslations(dash_length, @@ -1772,9 +1820,9 @@ label = XtCreateManagedWidget("default_dot_gap", labelWidgetClass, form, Args, ArgCount); - sprintf(buf, "%.1f", cur_dotgap); + sprintf(buf, "%.3f", cur_dotgap); below = MakeFloatSpinnerEntry(form, &dot_gap, "dot_gap", below, label, - (XtCallbackProc) 0, buf, 0.0, 10000.0, 1.0, 40); + (XtCallbackProc) 0, buf, 0.0, 10000.0, 1.0, 55); /* enable mousefun kbd icon */ XtAugmentTranslations(dot_gap, @@ -2166,7 +2214,7 @@ below = MakeIntSpinnerEntry(form, &newvalue, "value", label, newvalue, (XtCallbackProc) 0, buf, isw->min, isw->max, (int)isw->inc, 45); } else { - sprintf(buf, "%.2f", (*isw->f_varadr)); + sprintf(buf, "%.3f", (*isw->f_varadr)); below = MakeFloatSpinnerEntry(form, &newvalue, "value", label, newvalue, (XtCallbackProc) 0, buf, (float)isw->min, (float)isw->max, isw->inc, 55); } @@ -2586,9 +2634,9 @@ beside = XtCreateManagedWidget("arrow_length_label", labelWidgetClass, arrowform, Args, ArgCount); /* length spinner */ - sprintf(indbuf,"%.1f",dimline_arrowlength); + sprintf(indbuf,"%.3f",dimline_arrowlength); beside = MakeFloatSpinnerEntry(arrowform, &arrow_length_w, "arrow_length", - below, beside, dimline_panel_preview, indbuf, 0.1, 200.0, 1.0, 40); + below, beside, dimline_panel_preview, indbuf, 0.1, 200.0, 1.0, 55); below = beside; @@ -2600,9 +2648,9 @@ beside = XtCreateManagedWidget("arrow_width_label", labelWidgetClass, arrowform, Args, ArgCount); /* width spinner */ - sprintf(indbuf,"%.1f",dimline_arrowwidth); + sprintf(indbuf,"%.3f",dimline_arrowwidth); beside = MakeFloatSpinnerEntry(arrowform, &arrow_width_w, "arrow_width", - below, beside, dimline_panel_preview, indbuf, 0.1, 200.0, 1.0, 40); + below, beside, dimline_panel_preview, indbuf, 0.1, 200.0, 1.0, 55); /****************************/ /* now frame for Ticks info */ @@ -3171,19 +3219,19 @@ c = 'x'; } - put_msg("Arrows: Thickness=%.1f, Width=%.1f, Height=%.1f (Button 1 to change)", + put_msg("Arrows: Thickness=%.3f, Width=%.3f, Height=%.3f (Button 1 to change)", thick, width, height); /* write the current setting in the background pixmap */ switch(cur_arrowsizeshown) { case 0: - sprintf(indbuf, "Thk=%.1f %c ",thick,c); + sprintf(indbuf, "Thk=%.3f %c ",thick,c); break; case 1: - sprintf(indbuf, "Wid=%.1f %c ",width,c); + sprintf(indbuf, "Wid=%.3f %c ",width,c); break; default: - sprintf(indbuf, "Ht =%.1f %c ",height,c); + sprintf(indbuf, "Ht =%.3f %c ",height,c); } update_string_pixmap(sw, indbuf, 6, 26); } @@ -3612,15 +3660,38 @@ cur_pointposn = P_ANY; update_choice_pixmap(sw, cur_pointposn); + switch (cur_pointposn) { case P_ANY: put_msg("Arbitrary Positioning of Points"); break; + case P_USER: + if (cur_user_pointposn < MIN_POINTPOSN) + cur_user_pointposn = 1; + else if (cur_user_pointposn > MAX_POINTPOSN) + cur_user_pointposn = MAX_POINTPOSN; + + put_msg("User Defined MAGNET MODE: entered points rounded " + "to the nearest %f %s increment", + cur_user_pointposn, posn_basename[cur_gridunit]); + + /* write the current pointposn in the background pixmap */ + memset(indbuf, 0, sizeof(indbuf)); + if(cur_user_pointposn >= 1000) + sprintf(indbuf, "%4.0f", cur_user_pointposn); + else if(cur_user_pointposn >= 100) + sprintf(indbuf, "%3.1f", cur_user_pointposn); + else if(cur_user_pointposn >= 10) + sprintf(indbuf, "%2.2f", cur_user_pointposn); + else + sprintf(indbuf, "%1.3f", cur_user_pointposn); + + update_string_pixmap(sw, indbuf, sw->sw_width - 32, 28); + break; default: - sprintf(buf, - "MAGNET MODE: entered points rounded to the nearest %s increment", - grid_name[cur_gridunit][cur_pointposn-1]); - put_msg(buf); + put_msg("MAGNET MODE: entered points rounded " + "to the nearest %s increment", + grid_name[cur_gridunit][cur_pointposn-2]); break; } } @@ -4060,7 +4131,7 @@ if (cur_elltextangle <= -360.0 || cur_elltextangle >= 360) cur_elltextangle = 0.0; - put_msg("Text/Ellipse angle %.1f", cur_elltextangle); + put_msg("Text/Ellipse angle %.3f", cur_elltextangle); if (cur_elltextangle == old_elltextangle) return; @@ -4137,7 +4208,7 @@ cur_rotnangle = 360.0; if (panel) - put_msg("Angle of rotation %.2f", cur_rotnangle); + put_msg("Angle of rotation %.3f", cur_rotnangle); if (cur_rotnangle == old_rotnangle) return; @@ -4586,10 +4657,10 @@ } } else if (display_zoomscale < 10.0) { display_zoomscale = (double) ((int) (display_zoomscale*100.0+0.5))/100.0; - sprintf(indbuf, " %.2f", display_zoomscale); + sprintf(indbuf, " %.3f", display_zoomscale); } else if (display_zoomscale < 100.0) { display_zoomscale = (double) ((int) (display_zoomscale*10.0+0.5))/10.0; - sprintf(indbuf, " %.1f", display_zoomscale); + sprintf(indbuf, " %.3f", display_zoomscale); } else { display_zoomscale = (double) ((int) display_zoomscale+0.5); sprintf(indbuf, "%.0f",display_zoomscale); @@ -4694,7 +4765,7 @@ cur_textstep = (float) MAX_TEXT_STEP; cur_textstep = round(cur_textstep*10.0)/10.0; - put_msg("Text step %.1f", cur_textstep); + put_msg("Text step %.3f", cur_textstep); /* write the text step in the background pixmap */ indbuf[0] = indbuf[1] = indbuf[2] = indbuf[3] = indbuf[4] = '\0'; sprintf(indbuf, "%4.1f", cur_textstep); diff -w -x '*.o' -u /tmp/xfig.3.2.4/w_setup.h xfig.3.2.4/w_setup.h --- /tmp/xfig.3.2.4/w_setup.h 2002-11-05 18:26:34.000000000 +0100 +++ xfig.3.2.4/w_setup.h 2003-01-26 23:59:25.000000000 +0100 @@ -19,8 +19,10 @@ #define W_SETUP_H #define PIX_PER_INCH 1200 -#define PIX_PER_CM 450 /* closest to correct (472.4) and still - have the rulers look good */ +/* closest to correct (472.4) and still have the rulers look good */ +#define PIX_PER_CM 450 +/* this would be nicer with respect to 1/8 POSN steps */ +/* #define PIX_PER_CM 480 */ /* shorthand */ #define PPI PIX_PER_INCH diff -w -x '*.o' -u /tmp/xfig.3.2.4/w_util.c xfig.3.2.4/w_util.c --- /tmp/xfig.3.2.4/w_util.c 2002-12-11 23:04:04.000000000 +0100 +++ xfig.3.2.4/w_util.c 2003-01-26 22:31:23.000000000 +0100 @@ -646,7 +646,7 @@ val = spins->min; if (val > spins->max) val = spins->max; - sprintf(str,"%0.2f",val); + sprintf(str,"%0.3f",val); FirstArg(XtNstring, str); SetValues(textwidg); FirstArg(XtNinsertPosition, strlen(str)); @@ -672,7 +672,7 @@ val = spins->min; if (val > spins->max) val = spins->max; - sprintf(str,"%0.2f",val); + sprintf(str,"%0.3f",val); FirstArg(XtNstring, str); SetValues(textwidg); FirstArg(XtNinsertPosition, strlen(str)); Only in xfig.3.2.4/: xfig.1.html Only in xfig.3.2.4/: xfig._man Only in xfig.3.2.4/: xfig.exe Only in xfig.3.2.4/: xfig.man