Changeset 17120
- Timestamp:
- Mar 24, 2008, 6:19:27 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/kapa2/src/PaintOverlay.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/kapa2/src/PaintOverlay.c
r16255 r17120 5 5 int i; 6 6 int dX, dY, dx, dy; 7 int x, y, X , Y, Xmin, Ymin, Xmax, Ymax, Xrange, Yrange;8 double t, expand, X 0, Y0;7 int x, y, Xmin, Ymin, Xmax, Ymax, Xrange, Yrange; 8 double t, expand, X, Y; 9 9 10 10 XSetForeground (graphic[0].display, graphic[0].gc, image[0].overlay[N].color); … … 12 12 expand = 1.0; 13 13 if (image[0].picture.expand > 0) { 14 expand = 1 / (1.0*image[0].picture.expand);14 expand = image[0].picture.expand; 15 15 } 16 16 if (image[0].picture.expand < 0) { 17 expand = fabs((double)image[0].picture.expand);17 expand = 1.0 / fabs((double)image[0].picture.expand); 18 18 } 19 20 Image_to_Screen (&X0, &Y0, 0.0, 0.0, &image[0].picture);21 19 22 20 Xmin = image[0].picture.x; … … 28 26 29 27 for (i = 0; i < image[0].overlay[N].Nobjects; i++) { 30 X = image[0].overlay[N].objects[i].x/expand + X0; 31 Y = image[0].overlay[N].objects[i].y/expand + Y0; 32 dX = image[0].overlay[N].objects[i].dx/expand; 33 dY = image[0].overlay[N].objects[i].dy/expand; 34 if ((X + dX < Xmin) || (X - dX > Xmax) || 35 (Y + dY < Ymin) || (Y - dY > Ymax)) { 36 continue; 37 } 28 Image_to_Screen (&X, &Y, image[0].overlay[N].objects[i].x, image[0].overlay[N].objects[i].y, &image[0].picture); 29 dX = image[0].overlay[N].objects[i].dx * expand; 30 dY = image[0].overlay[N].objects[i].dy * expand; 31 if (image[0].picture.flipx) dX *= -1; 32 if (image[0].picture.flipy) dY *= -1; 33 34 if (X + dX < Xmin) continue; 35 if (X - dX > Xmax) continue; 36 if (Y + dY < Ymin) continue; 37 if (Y - dY > Ymax); 38 38 39 39 /* for a LINE, (x, y) is the start, (dx, dy) is the distance to end
Note:
See TracChangeset
for help on using the changeset viewer.
