# include "Ximage.h"

int Center (int sock) {

  int zoom;
  double X, Y;
  Graphic *graphic;
  Section *section;
  KapaImageWidget *image;

  KiiScanMessage (sock, "%lf %lf %d", &X,  &Y, &zoom);

  graphic = GetGraphic();
  section = GetActiveSection();
  image = section->image;
  if (image == NULL) return (TRUE);

  image[0].X = 0.5*image[0].image[0].matrix.Naxis[0] - X;
  image[0].Y = 0.5*image[0].image[0].matrix.Naxis[1] - Y;
  if ((zoom != 0) && (zoom != -1)) {
    image[0].expand = zoom;
  }

  if (USE_XWINDOW) {
    Remap (graphic, image);
    Refresh ();
    XFlush (graphic[0].display);
  }

  return (TRUE);
}

