private void simple_rect_fill(int x1, int y1, int x2, int y2) {
    if (y2 < y1) {
      int temp = y1; y1 = y2; y2 = temp;
    }
    if (x2 < x1) {
      int temp = x1; x1 = x2; x2 = temp;
    }
    // check to see if completely off-screen (e.g. if the left edge of the
    // rectangle is bigger than the width, and so on.)
    if ((x1 > width1) || (x2 < 0) ||
        (y1 > height1) || (y2 < 0)) return;

    // these only affect the fill, not the stroke
    // (otherwise strange boogers at edges b/c frame changes shape)
    if (x1 < 0) x1 = 0;
    if (x2 > width) x2 = width;
    if (y1 < 0) y1 = 0;
    if (y2 > height) y2 = height;

    int ww = x2 - x1;

    if (fillAlpha) {
      for (int y = y1; y < y2; y++) {
        int index = y*width + x1;
        for (int x = 0; x < ww; x++) {
          pixels[index] = blend_fill(pixels[index]);
          index++;
        }
      }

    } else {
      // on avg. 20-25% faster fill routine using System.arraycopy() [toxi 031223]
      // removed temporary row[] array for (hopefully) better performance [fry 081117]
      int hh = y2 - y1;
      //    int[] row = new int[ww];
      //    for (int i = 0; i < ww; i++) row[i] = fillColor;
      int index = y1 * width + x1;
      int rowIndex = index;
      for (int i = 0; i < ww; i++) {
        pixels[index + i] = fillColor;
      }
      for (int y = 0; y < hh; y++) {
        //      System.arraycopy(row, 0, pixels, idx, ww);
        System.arraycopy(pixels, rowIndex, pixels, index, ww);
        index += width;
      }
      //    row = null;
    }
  }