Changeset 204 for trunk/UGame.pas


Ignore:
Timestamp:
May 20, 2018, 10:23:13 PM (6 years ago)
Author:
chronos
Message:
  • Fixed: Zoom all action was not working if a map was loaded from a file.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UGame.pas

    r203 r204  
    184184  private
    185185    FSize: TPoint;
     186    function GetPixelRect: TRect;
    186187    function GetSize: TPoint; virtual;
    187188    procedure PaintCell(Canvas: TCanvas; Pos: TPoint; Text: string; View: TView;
     
    230231    procedure ForEachCells(Method: TMethod); virtual;
    231232    property Size: TPoint read GetSize write SetSize;
    232     property PixelRect: TRect read FPixelRect;
     233    property PixelRect: TRect read GetPixelRect;
    233234  end;
    234235
     
    12551256end;
    12561257
     1258function TMap.GetPixelRect: TRect;
     1259begin
     1260  if FPixelRect.Empty then FPixelRect := CalculatePixelRect;
     1261  Result := FPixelRect;
     1262end;
     1263
    12571264procedure TMap.SetSize(AValue: TPoint);
    12581265begin
     
    14151422  if Assigned(Node2) then
    14161423    CellLinks.LoadFromNode(Node2);
     1424  FPixelRect := CalculatePixelRect;
    14171425end;
    14181426
     
    15761584    Cells[Y * FSize.X + X] := NewCell;
    15771585  end;
    1578   FPixelRect := CalculatePixelRect;
     1586  FPixelRect := FPixelRect;
    15791587end;
    15801588
     
    16561664  Cells.Clear;
    16571665  FNewCellId := 1;
     1666  FPixelRect.SetEmpty;
    16581667end;
    16591668
Note: See TracChangeset for help on using the changeset viewer.