Issue: TMufasaBitmap.drawClippedBox out of bound error

  1. issueid=478 08-10-2016 04:14 PM
    SRL Junior Member
    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));
Issue Details
Issue Number 478
Project SRL Bugs and Suggestions
Status Unconfirmed
Users able to reproduce bug 0
Users unable to reproduce bug 0
Assigned Users (none)
Tags (none)




+ Reply