Changeset 545 for trunk


Ignore:
Timestamp:
Apr 17, 2024, 10:23:55 AM (8 months ago)
Author:
chronos
Message:
  • Fixed: Incorrect range checking in scaled bitmap drawing method.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Term.pas

    r537 r545  
    26972697
    26982698        MiniMap.Size := Point(G.lx, G.ly);
    2699         for I := 0 to nPl - 1 do
    2700         begin
     2699        MiniMap.Bitmap.SetSize(MiniMap.Size.X * 2, MiniMap.Size.Y);
     2700
     2701        for I := 0 to nPl - 1 do begin
    27012702          Tribe[I] := nil;
    27022703          TribeOriginal[I] := False;
     
    66196620            Application.ProcessMessages;
    66206621          Sleep(1);
    6621           Inc(SliceCount)
     6622          Inc(SliceCount);
    66226623        end;
    66236624        Ticks := NowPrecise;
  • trunk/MiniMap.pas

    r520 r545  
    5757  for X := 0 to 11 do
    5858    for Y := 0 to 1 do
    59       Colors[x, y] := HGrSystem.Data.Canvas.Pixels[66 + x, 67 + y];
     59      Colors[X, Y] := HGrSystem.Data.Canvas.Pixels[66 + X, 67 + Y];
    6060end;
    6161
  • 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.