*** ProgBarP.h 1997/09/15 04:51:25 1.2 --- ProgBarP.h 1997/10/11 02:37:56 *************** *** 103,110 **** * Strings for labeling beginning and end of progress bar. */ Dimension percheight; - Dimension zerowidth; - Dimension hundredwidth; Dimension label_height; Dimension label_width; --- 103,108 ---- *** bdfgrid.c 1997/10/08 05:24:51 1.11 --- bdfgrid.c 1997/10/11 02:42:41 *************** *** 1124,1135 **** * **************************************************************************/ static int #ifdef __STDC__ ! _bdf_rotate_selection(bdf_glyph_grid_t *grid, short degrees) #else ! _bdf_rotate_selection(grid, degrees) bdf_glyph_grid_t *grid; short degrees; #endif { --- 1124,1164 ---- * **************************************************************************/ + static short + #ifdef __STDC__ + my_ceiling(double v) + #else + my_ceiling(v) + double v; + #endif + { + short val, neg; + + val = neg = 0; + if (v < 0) { + neg = 1; + while (v < -1.0) { + val++; + v += 1.0; + } + } else if (v > 0) { + while (v > 1.0) { + val++; + v -= 1.0; + } + if (v > 0.0) + val++; + } + return (!neg) ? val : -val; + } + static int #ifdef __STDC__ ! _bdf_rotate_selection(bdf_glyph_grid_t *grid, int mul90, short degrees) #else ! _bdf_rotate_selection(grid, mul90, degrees) bdf_glyph_grid_t *grid; + int mul90; short degrees; #endif { *************** *** 1163,1177 **** for (shiftx = shifty = y = 0; y < ht; y++) { for (x = 0; x < wd; x++) { - ox = nx = x; - oy = ny = y; - dx = (double) (x - cx); dy = (double) (y - cy); ! nx = cx + (short) ((dx * cos_tbl[degrees]) - ! (dy * sin_tbl[degrees])); ! ny = cy + (short) ((dx * sin_tbl[degrees]) + ! (dy * cos_tbl[degrees])); /* * Wrap the coordinates around the edges if necessary. --- 1192,1210 ---- for (shiftx = shifty = y = 0; y < ht; y++) { for (x = 0; x < wd; x++) { dx = (double) (x - cx); dy = (double) (y - cy); ! if (mul90) { ! nx = cx + (short) ((dx * cos_tbl[degrees]) - ! (dy * sin_tbl[degrees])); ! ny = cy + (short) ((dx * sin_tbl[degrees]) + ! (dy * cos_tbl[degrees])); ! } else { ! nx = cx + my_ceiling((dx * cos_tbl[degrees]) - ! (dy * sin_tbl[degrees])); ! ny = cy + my_ceiling((dx * sin_tbl[degrees]) + ! (dy * cos_tbl[degrees])); ! } /* * Wrap the coordinates around the edges if necessary. *************** *** 1317,1323 **** short degrees; #endif { ! int rotated; short nx, ny, cx, cy, x, y, wd, ht; short ox, oy, gx, gy, shiftx, shifty; double dx, dy; --- 1350,1356 ---- short degrees; #endif { ! int rotated, mul90; short nx, ny, cx, cy, x, y, wd, ht; short ox, oy, gx, gy, shiftx, shifty; double dx, dy; *************** *** 1339,1346 **** (grid->glyph_bbx.width == 0 && grid->glyph_bbx.height == 0)) return rotated; if (grid->sel.width != 0 && grid->sel.height != 0) ! return _bdf_rotate_selection(grid, degrees); /* * Halve the byte count in the grid for later use. --- 1372,1381 ---- (grid->glyph_bbx.width == 0 && grid->glyph_bbx.height == 0)) return rotated; + mul90 = ((degrees % 90) == 0) ? 1 : 0; + if (grid->sel.width != 0 && grid->sel.height != 0) ! return _bdf_rotate_selection(grid, mul90, degrees); /* * Halve the byte count in the grid for later use. *************** *** 1399,1412 **** /* * Rotate the point. */ - ox = nx = x; - oy = ny = y; dx = (double) (x - cx); dy = (double) (y - cy); ! nx = cx + (short) ((dx * cos_tbl[degrees]) - ! (dy * sin_tbl[degrees])); ! ny = cy + (short) ((dx * sin_tbl[degrees]) + ! (dy * cos_tbl[degrees])); /* * Wrap the coordinates around the edges if necessary. --- 1434,1452 ---- /* * Rotate the point. */ dx = (double) (x - cx); dy = (double) (y - cy); ! if (mul90) { ! nx = cx + (short) ((dx * cos_tbl[degrees]) - ! (dy * sin_tbl[degrees])); ! ny = cy + (short) ((dx * sin_tbl[degrees]) + ! (dy * cos_tbl[degrees])); ! } else { ! nx = cx + my_ceiling((dx * cos_tbl[degrees]) - ! (dy * sin_tbl[degrees])); ! ny = cy + my_ceiling((dx * sin_tbl[degrees]) + ! (dy * cos_tbl[degrees])); ! } /* * Wrap the coordinates around the edges if necessary.