Ignore:
Timestamp:
Apr 17, 2024, 10:23:55 AM (7 months ago)
Author:
chronos
Message:
  • Fixed: Incorrect range checking in scaled bitmap drawing method.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/DpiControls/Dpi.Common.pas

    r539 r545  
    7676  end;
    7777
     78  if XSrc < 0 then begin
     79    X := X - XSrc;
     80    Width := Width - XSrc;
     81    XSrc := 0;
     82  end;
     83  if YSrc < 0 then begin
     84    Y := Y - YSrc;
     85    Height := Height - YSrc;
     86    YSrc := 0;
     87  end;
     88
    7889  if X < 0 then begin
    7990    Width := Width + X;
     
    8697    Y := 0;
    8798  end;
    88   if (X + Width) > Dest.Width then begin
     99  if (X + Width) >= Dest.Width then begin
    89100    Width := Dest.Width - X;
    90101  end;
    91   if (Y + Height) > Dest.Height then begin
     102  if (Y + Height) >= Dest.Height then begin
    92103    Height := Dest.Height - Y;
     104  end;
     105  if (Width < 0) or (Height < 0) then begin
     106    Result := True;
     107    Exit;
    93108  end;
    94109
Note: See TracChangeset for help on using the changeset viewer.