TMufasaBitmap.drawClippedBox out of bound error
drawClippedBox is still able to pass outside of the bitmap bounds
Simba Code:
procedure TMufasaBitmap.drawClippedBox(box: TBox; fill: boolean; color: TColor);
var
b: TBox;
begin
b.x1 := max(box.x1, 0);
b.y1 := max(box.y1, 0);
b.x2 := min(box.x2, self.getWidth() - 1);
b.y2 := min(box.y2, self.getHeight() - 1);
self.drawBox(b, fill, color);
end;
If b.x2 or b.y2 are below 0, then an out of range exception occurs. The fix:
Simba Code:
b.x2 := max(0, min(box.x2, self.getWidth() - 1));
b.y2 := max(0, min(box.y2, self.getHeight() - 1));