code: function getRect() //{{{
        {
          var xsize = x2 - x1,
              ysize = y2 - y1,
              delta;
  
          if (xlimit && (Math.abs(xsize) > xlimit)) {
            x2 = (xsize > 0) ? (x1 + xlimit) : (x1 - xlimit);
          }
          if (ylimit && (Math.abs(ysize) > ylimit)) {
            y2 = (ysize > 0) ? (y1 + ylimit) : (y1 - ylimit);
          }
  
          if (ymin / yscale && (Math.abs(ysize) < ymin / yscale)) {
            y2 = (ysize > 0) ? (y1 + ymin / yscale) : (y1 - ymin / yscale);
          }
          if (xmin / xscale && (Math.abs(xsize) < xmin / xscale)) {
            x2 = (xsize > 0) ? (x1 + xmin / xscale) : (x1 - xmin / xscale);
          }
  
          if (x1 < 0) {
            x2 -= x1;
            x1 -= x1;
          }
          if (y1 < 0) {
            y2 -= y1;
            y1 -= y1;
          }
          if (x2 < 0) {
            x1 -= x2;
            x2 -= x2;
          }
          if (y2 < 0) {
            y1 -= y2;
            y2 -= y2;
          }
          if (x2 > boundx) {
            delta = x2 - boundx;
            x1 -= delta;
            x2 -= delta;
          }
          if (y2 > boundy) {
            delta = y2 - boundy;
            y1 -= delta;
            y2 -= delta;
          }
          if (x1 > boundx) {
            delta = x1 - boundy;
            y2 -= delta;
            y1 -= delta;
          }
          if (y1 > boundy) {
            delta = y1 - boundy;
            y2 -= delta;
            y1 -= delta;
          }
  
          return makeObj(flipCoords(x1, y1, x2, y2));
        }
docs: }}}