Changeset 16228 for trunk/Ohana/src/kapa2/src/Reorient.c
- Timestamp:
- Jan 24, 2008, 5:45:18 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/kapa2/src/Reorient.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/kapa2/src/Reorient.c
r16011 r16228 3 3 void Reorient (Graphic *graphic, KapaImageWidget *image, double X, double Y, int mode) { 4 4 5 if (image[0].expand == 0) image[0].expand = 1;5 Picture *picture; 6 6 7 if ((image[0].X == X) && (image[0].Y == Y) && (mode == 0)) { 7 picture = &image[0].picture; 8 9 if (picture[0].expand == 0) picture[0].expand = 1; 10 11 if ((picture[0].X == X) && (picture[0].Y == Y) && (mode == 0)) { 8 12 Refresh (); 9 13 XFlush (graphic[0].display); … … 13 17 switch (mode) { 14 18 case 0: 15 if (( image[0].X != X) || (image[0].Y != Y)) {16 image[0].X = X;17 image[0].Y = Y;19 if ((picture[0].X != X) || (picture[0].Y != Y)) { 20 picture[0].X = X; 21 picture[0].Y = Y; 18 22 } 19 23 break; 20 24 case -1: 21 image[0].expand--; 22 if ((image[0].expand == 0) || (image[0].expand == -1)) 23 image[0].expand = -2; 24 if (image[0].expand < -30) { 25 fprintf (stderr, "can't get smaller!\n"); 26 image[0].expand = -30; 27 return; 28 } 29 image[0].X = X; 30 image[0].Y = Y; 25 picture[0].expand--; 26 if ((picture[0].expand == 0) || (picture[0].expand == -1)) picture[0].expand = -2; 27 picture[0].X = X; 28 picture[0].Y = Y; 31 29 break; 32 30 case +1: 33 image[0].expand++; 34 if ((image[0].expand == 0) || (image[0].expand == -1)) 35 image[0].expand = 1; 36 if (image[0].expand > 30) { 37 fprintf (stderr, "can't get bigger!\n"); 38 image[0].expand = 30; 39 return; 40 } 41 image[0].X = X; 42 image[0].Y = Y; 31 picture[0].expand++; 32 if ((picture[0].expand == 0) || (picture[0].expand == -1)) picture[0].expand = 1; 33 picture[0].X = X; 34 picture[0].Y = Y; 43 35 break; 44 36 } … … 49 41 XFlush (graphic[0].display); 50 42 } 51 52 # if (0) /* the "warp" function seems to be a problem on SUNs for some reason */53 XQueryPointer (graphic[0].display, graphic[0].window, &dummy1, &dummy1, &dummy2, &dummy2, &x, &y, &dummy3);54 if ((x > image[0].picture.x) && (x < image[0].picture.x + image[0].picture.dx) &&55 (y > image[0].picture.y) && (y < image[0].picture.y + image[0].picture.dy) &&56 ((mouse_event[0].button == 2) || (mouse_event[0].button == 3))) {57 XWarpPointer (graphic[0].display, None, graphic[0].window, 0, 0, 0, 0,58 image[0].picture.x + 0.5*image[0].picture.dx,59 image[0].picture.y + 0.5*image[0].picture.dy);60 }61 # endif62
Note:
See TracChangeset
for help on using the changeset viewer.
