A C++ (ft2font.cpp) question

Hi all,

I implemented the following method in ft2font.cpp, and although it
works I don't know if it does the *right thing*.

char FT2Font::draw_rect_filled__doc__[] =
"draw_rect_filled(x0, y0, x1, y1)\n"
"Draw a filled rect to the image. It is your responsibility to set the\n"
"dimensions of the image, eg, with set_bitmap_size\n"
FT2Font::draw_rect_filled(const Py::Tuple & args) {


  long x0 = Py::Int(args[0]);
  long y0 = Py::Int(args[1]);
  long x1 = Py::Int(args[2]);
  long y1 = Py::Int(args[3]);

  FT_Int iwidth = (FT_Int)image.width;
  FT_Int iheight = (FT_Int)image.height;

  if ( x0<0 || y0<0 || x1<0 || y1<0 ||
       x0>iwidth || x1>iwidth ||
       y0>iheight || y1>iheight )
    throw Py::ValueError("Rect coords outside image bounds");

  for (long j=y0; j<y1; ++j) {
      for (long i=x0; i<x1+1; ++i) {
        image.buffer[i + j*iwidth] = 255;
  return Py::Object();

Basically, I copied the existing draw_rect method and changed the code
a bit. The above code draws a filled rectangle in the image buffer. I
use it mathtext for drawing a line (for a fraction etc.). What I'm
interested is the for loop:

for (long j=y0; j<y1; ++j) {
      for (long i=x0; i<x1+1; ++i) {
        image.buffer[i + j*iwidth] = 255;

I'm not sure that this is the right code - probably some pixel isn't
getting drawn. Anyone has some ideas?