Changeset 13471
- Timestamp:
- May 22, 2007, 10:43:58 AM (19 years ago)
- Location:
- branches/kapa-mods-2007-05/Ohana/src/kapa2/src
- Files:
-
- 2 edited
-
SetGraphSize.c (modified) (2 diffs)
-
SetImageSize.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/SetGraphSize.c
r13320 r13471 7 7 8 8 int fontsize, bump, Nc; 9 int textpad, textdY, WdY; 9 10 double PADx, PADy, Dx, Dy; 10 11 double PXm, PXp, PYm, PYp; … … 32 33 PYp = (graph[0].axis[2].islabel) ? 4*fontsize : 0; 33 34 34 /* size of the graph in Xwindow coordinates */35 /* basic size of the graph in Xwindow coordinates */ 35 36 X0 = PADx + PXm + (Dx * section[0].x); 36 37 Y0 = PADy + PYm + (Dy * section[0].y); 37 38 dX = (Dx * section[0].dx) - PXp - PXm; 38 39 dY = (Dy * section[0].dy) - PYp - PYm; 40 41 // if we are tied to an image, make mods as needed 42 if (section->image) { 43 textpad = graphic[0].font[0].ascent; 44 textdY = 6*textpad + 7*PAD1; 45 WdY = MAX (ZOOM_Y, textdY + 2*BUTTON_HEIGHT + PAD1); 46 47 switch (section->image->location) { 48 case 1: 49 Y0 = graphic[0].dy * section[0].y + 2*PAD1 + WdY + 2; // tied to image in Y 50 dY = graphic[0].dy * section[0].dy - 5*PAD1 - WdY - COLORPAD + 1; 51 break; 52 case 3: 53 dY = graphic[0].dy * section[0].dy - 5*PAD1 - WdY - COLORPAD - PADy - PYm; 54 break; 55 case 2: 56 X0 = graphic[0].dx * section[0].x + 2*PAD1 + ZOOM_X; 57 dX = graphic[0].dx * section[0].dx - 3*PAD1 - ZOOM_X; 58 break; 59 case 4: 60 dX = graphic[0].dx * section[0].dx - 3*PAD1 - ZOOM_X - PADx - PXm; 61 break; 62 } 63 } 39 64 40 65 /* define locations of coordinate axes */ -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/SetImageSize.c
r13432 r13471 29 29 case 0: 30 30 if (section->graph) { 31 image[0].picture.x = graph[0].axis[0].fx; 32 image[0].picture.y = graph[0].axis[1].fy + graph[0].axis[1].dfy; 33 image[0].picture.dx = graph[0].axis[0].dfx; 34 image[0].picture.dy = -graph[0].axis[1].dfy; 35 } else { 31 image[0].picture.x = graph[0].axis[0].fx; 32 image[0].picture.y = graph[0].axis[1].fy + graph[0].axis[1].dfy; 33 image[0].picture.dx = MAX(graph[0].axis[0].dfx + 1, 1); 34 image[0].picture.dy = MAX(fabs(graph[0].axis[1].dfy) - 1, 1); 35 } else { 36 image[0].picture.x = Xs + PAD1; 37 image[0].picture.y = Ys + PAD1; 36 38 image[0].picture.dx = dX - 2*PAD1; 37 39 image[0].picture.dy = dY - 2*PAD1; 38 image[0].picture.x = Xs + PAD1;39 image[0].picture.y = Ys + PAD1;40 40 } 41 41 if (USE_XWINDOW) CreatePicture (image, graphic); … … 48 48 WdY = MAX (ZOOM_Y, textdY + 2*BUTTON_HEIGHT + PAD1); 49 49 50 image[0].picture.dx = dX - 2*PAD1; 51 image[0].picture.dy = dY - 5*PAD1 - WdY - COLORPAD; 52 image[0].picture.x = Xs + PAD1; 53 image[0].picture.y = Ys + 2*PAD1 + COLORPAD; 50 if (section->graph) { 51 image[0].picture.x = graph[0].axis[0].fx; 52 image[0].picture.y = Ys + 2*PAD1 + COLORPAD; 53 image[0].picture.dx = graph[0].axis[0].dfx; 54 image[0].picture.dy = dY - 5*PAD1 - WdY - COLORPAD; 55 } else { 56 image[0].picture.x = Xs + PAD1; 57 image[0].picture.y = Ys + 2*PAD1 + COLORPAD; 58 image[0].picture.dx = dX - 2*PAD1; 59 image[0].picture.dy = dY - 5*PAD1 - WdY - COLORPAD; 60 } 54 61 55 62 image[0].cmapbar.dx = dX - 2*PAD1; … … 108 115 WdY = MAX (ZOOM_Y, textdY + 2*BUTTON_HEIGHT + PAD1); 109 116 110 image[0].picture.dx = dX - 2*PAD1; 111 image[0].picture.dy = dY - 5*PAD1 - WdY - COLORPAD; 112 image[0].picture.x = Xs + PAD1; 113 image[0].picture.y = Ys + 4*PAD1 + COLORPAD + WdY; 117 if (section->graph) { 118 image[0].picture.x = graph[0].axis[0].fx; 119 image[0].picture.y = graph[0].axis[1].fy + graph[0].axis[1].dfy; 120 image[0].picture.dx = MAX(graph[0].axis[0].dfx, 1); 121 image[0].picture.dy = MAX(fabs(graph[0].axis[1].dfy) - 1, 1); 122 } else { 123 image[0].picture.dx = dX - 2*PAD1; 124 image[0].picture.dy = dY - 5*PAD1 - WdY - COLORPAD; 125 image[0].picture.x = Xs + PAD1; 126 image[0].picture.y = Ys + 4*PAD1 + COLORPAD + WdY; 127 } 114 128 115 129 image[0].cmapbar.dx = dX - 2*PAD1; … … 164 178 165 179 case 2: 166 image[0].picture.dx = dX - 3*PAD1 - ZOOM_X; 167 image[0].picture.dy = dY - 3*PAD1 - COLORPAD; 168 image[0].picture.x = Xs + 2*PAD1 + ZOOM_X; 169 image[0].picture.y = Ys + 2*PAD1 + COLORPAD; 180 181 if (section->graph) { 182 image[0].picture.x = Xs + 2*PAD1 + ZOOM_X; 183 image[0].picture.y = graph[0].axis[1].fy + graph[0].axis[1].dfy; 184 image[0].picture.dx = dX - 3*PAD1 - ZOOM_X; 185 image[0].picture.dy = MAX(fabs(graph[0].axis[1].dfy) - 1, 1); 186 } else { 187 image[0].picture.dx = dX - 3*PAD1 - ZOOM_X; 188 image[0].picture.dy = dY - 3*PAD1 - COLORPAD; 189 image[0].picture.x = Xs + 2*PAD1 + ZOOM_X; 190 image[0].picture.y = Ys + 2*PAD1 + COLORPAD; 191 } 170 192 171 193 image[0].cmapbar.dx = dX - 2*PAD1; … … 221 243 222 244 case 4: 223 image[0].picture.dx = dX - 3*PAD1 - ZOOM_X; 224 image[0].picture.dy = dY - 3*PAD1 - COLORPAD; 225 image[0].picture.x = Xs + PAD1; 226 image[0].picture.y = Ys + 2*PAD1 + COLORPAD; 245 246 if (section->graph) { 247 image[0].picture.x = graph[0].axis[0].fx; 248 image[0].picture.y = graph[0].axis[1].fy + graph[0].axis[1].dfy; 249 image[0].picture.dx = dX - 3*PAD1 - ZOOM_X - graph[0].axis[0].fx; 250 image[0].picture.dy = MAX(fabs(graph[0].axis[1].dfy) - 1, 1); 251 } else { 252 image[0].picture.dx = dX - 3*PAD1 - ZOOM_X; 253 image[0].picture.dy = dY - 3*PAD1 - COLORPAD; 254 image[0].picture.x = Xs + PAD1; 255 image[0].picture.y = Ys + 2*PAD1 + COLORPAD; 256 } 227 257 228 258 image[0].cmapbar.dx = dX - 2*PAD1;
Note:
See TracChangeset
for help on using the changeset viewer.
