OK! Now I see what are you talking about. Couldn't really figure that out because me and C-like syntax don't get along pretty well

Any way looking at your code I'm wondering a few things.
  1. When calculating dx and dy values why don't you simply use:
    Code:
    dx := ABS(x2-x1);
    dy := ABS(y2-y1);
  2. Also looking at you code it seems as if you are using a for loop to determine the width of line rectangles. Isn't that very slow?
    Wouldn't it be easier to calculate the width of horizontal lines (line segments) that will represent your diagonal line by simply dividing the dx with dy?