IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13471


Ignore:
Timestamp:
May 22, 2007, 10:43:58 AM (19 years ago)
Author:
eugene
Message:

fixed overlapping image/graph sizes

Location:
branches/kapa-mods-2007-05/Ohana/src/kapa2/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/SetGraphSize.c

    r13320 r13471  
    77
    88  int fontsize, bump, Nc;
     9  int textpad, textdY, WdY;
    910  double PADx, PADy, Dx, Dy;
    1011  double PXm, PXp, PYm, PYp;
     
    3233  PYp = (graph[0].axis[2].islabel) ? 4*fontsize : 0;
    3334 
    34   /* size of the graph in Xwindow coordinates */
     35  /* basic size of the graph in Xwindow coordinates */
    3536  X0 = PADx + PXm + (Dx * section[0].x);
    3637  Y0 = PADy + PYm + (Dy * section[0].y);
    3738  dX = (Dx * section[0].dx) - PXp - PXm;
    3839  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  }
    3964
    4065  /* define locations of coordinate axes */
  • branches/kapa-mods-2007-05/Ohana/src/kapa2/src/SetImageSize.c

    r13432 r13471  
    2929    case 0:
    3030      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;
    3638          image[0].picture.dx = dX - 2*PAD1;
    3739          image[0].picture.dy = dY - 2*PAD1;
    38           image[0].picture.x = Xs + PAD1;
    39           image[0].picture.y = Ys + PAD1;
    4040      }
    4141      if (USE_XWINDOW) CreatePicture (image, graphic);
     
    4848      WdY = MAX (ZOOM_Y, textdY + 2*BUTTON_HEIGHT + PAD1);
    4949
    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      }
    5461
    5562      image[0].cmapbar.dx = dX - 2*PAD1;
     
    108115      WdY = MAX (ZOOM_Y, textdY + 2*BUTTON_HEIGHT + PAD1);
    109116
    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      }
    114128
    115129      image[0].cmapbar.dx = dX - 2*PAD1;
     
    164178
    165179    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      }
    170192
    171193      image[0].cmapbar.dx = dX - 2*PAD1;
     
    221243
    222244    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      }
    227257
    228258      image[0].cmapbar.dx = dX - 2*PAD1;
Note: See TracChangeset for help on using the changeset viewer.