Changeset 708


Ignore:
Timestamp:
Aug 19, 2025, 9:46:32 PM (19 hours ago)
Author:
chronos
Message:
  • Fixed: Crashes with mini map drawing in Start screen with some DPI resolutions.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MiniMap.pas

    r707 r708  
    239239          fTerrain, I];
    240240        if (PByte(MiniPixel.Pixel) >= Bitmap.RawImage.Data) and
    241         (PByte(MiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * MiniPixel.BytesPerLine)) then begin
     241        (PByte(MiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * MiniPixel.BytesPerLine) - 1) then begin
    242242          MiniPixel.PixelB := ((CM shr 16) and $FF) * Brightness div 3;
    243243          MiniPixel.PixelG := ((CM shr 8) and $FF) * Brightness div 3;
     
    283283              PrevMiniPixel.SetX(XM);
    284284              if (PByte(PrevMiniPixel.Pixel) >= Bitmap.RawImage.Data) and
    285               (PByte(PrevMiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * PrevMiniPixel.BytesPerLine)) then begin
     285              (PByte(PrevMiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * PrevMiniPixel.BytesPerLine) - 1) then begin
    286286                PrevMiniPixel.PixelB := CM shr 16;
    287287                PrevMiniPixel.PixelG:= CM shr 8 and $FF;
     
    296296            CM := Colors[Tile and fTerrain, I];
    297297          if (PByte(MiniPixel.Pixel) >= Bitmap.RawImage.Data) and
    298           (PByte(MiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * MiniPixel.BytesPerLine)) then begin
     298          (PByte(MiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * MiniPixel.BytesPerLine) - 1) then begin
    299299            MiniPixel.PixelB := (CM shr 16) and $ff;
    300300            MiniPixel.PixelG := (CM shr 8) and $ff;
     
    368368              PrevMiniPixel.SetX(XM);
    369369              if (PByte(PrevMiniPixel.Pixel) >= Bitmap.RawImage.Data) and
    370               (PByte(PrevMiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * PrevMiniPixel.BytesPerLine)) then begin
     370              (PByte(PrevMiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * PrevMiniPixel.BytesPerLine) - 1) then begin
    371371                PrevMiniPixel.PixelB := (CM shr 16) and $ff;
    372372                PrevMiniPixel.PixelG := (CM shr 8) and $ff;
     
    393393          end;
    394394          if (PByte(MiniPixel.Pixel) >= Bitmap.RawImage.Data) and
    395           (PByte(MiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * MiniPixel.BytesPerLine)) then begin
     395          (PByte(MiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * MiniPixel.BytesPerLine) - 1) then begin
    396396            MiniPixel.PixelB := (CM shr 16) and $ff;
    397397            MiniPixel.PixelG := (CM shr 8) and $ff;
Note: See TracChangeset for help on using the changeset viewer.