Changeset 6674 for trunk/Ohana/src/kii/picture/Reorient.c
- Timestamp:
- Mar 24, 2006, 2:42:35 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/kii/picture/Reorient.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/kii/picture/Reorient.c
r2466 r6674 1 1 # include "Ximage.h" 2 2 3 void Reorient (Graphic *graphic, Layout *layout, XButtonEvent *mouse_event) { 4 5 int x, y, dummy2; 6 double X0, Y0; 7 unsigned int dummy3; 8 Window dummy1; 3 void Reorient (Graphic *graphic, Layout *layout, double X, double Y, int mode) { 9 4 10 5 if (layout[0].expand == 0) 11 6 layout[0].expand = 1; 12 7 13 Screen_to_Image (&X0, &Y0, (double)mouse_event[0].x, (double)mouse_event[0].y, layout); 14 X0 = 0.5*layout[0].matrix.Naxis[0] - X0; 15 Y0 = 0.5*layout[0].matrix.Naxis[1] - Y0; 16 17 switch (mouse_event[0].button) { 18 case 1: 19 if ((layout[0].X != X0) || (layout[0].Y != Y0)) { 20 layout[0].X = X0; 21 layout[0].Y = Y0; 8 switch (mode) { 9 case 0: 10 if ((layout[0].X != X) || (layout[0].Y != Y)) { 11 layout[0].X = X; 12 layout[0].Y = Y; 22 13 } 23 14 break; 24 case 2:15 case -1: 25 16 layout[0].expand--; 26 17 if ((layout[0].expand == 0) || (layout[0].expand == -1)) … … 31 22 return; 32 23 } 33 layout[0].X = X 0;34 layout[0].Y = Y 0;24 layout[0].X = X; 25 layout[0].Y = Y; 35 26 break; 36 case 3:27 case +1: 37 28 layout[0].expand++; 38 29 if ((layout[0].expand == 0) || (layout[0].expand == -1)) … … 43 34 return; 44 35 } 45 layout[0].X = X 0;46 layout[0].Y = Y 0;36 layout[0].X = X; 37 layout[0].Y = Y; 47 38 break; 48 39 } … … 51 42 Refresh (graphic, layout, 0); 52 43 53 # ifndef NOWARP /* the "warp" function seems to be a problem on SUNs for some reason */ 44 XFlush (graphic[0].display); 45 } 46 47 # if (0) /* the "warp" function seems to be a problem on SUNs for some reason */ 54 48 XQueryPointer (graphic[0].display, graphic[0].window, &dummy1, &dummy1, &dummy2, &dummy2, &x, &y, &dummy3); 55 49 if ((x > layout[0].picture.x) && (x < layout[0].picture.x + layout[0].picture.dx) && … … 62 56 # endif 63 57 64 XFlush (graphic[0].display);65 }
Note:
See TracChangeset
for help on using the changeset viewer.
