Changeset 269 for trunk/UClientGUI.pas
- Timestamp:
- Jan 21, 2019, 12:38:20 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UClientGUI.pas
r268 r269 30 30 procedure CenterMap; 31 31 procedure CenterPlayerCity(Player: TPlayer); 32 procedure ZoomAll; 32 33 function CanvasToCellPos(Pos: TPoint): TPoint; 33 34 function CellToCanvasPos(Pos: TPoint): TPoint; … … 76 77 procedure TClientGUI.Paint(Canvas: TCanvas; View: TView); 77 78 begin 79 DrawCellLinks(Canvas, View); 78 80 DrawCells(Canvas, View); 81 DrawCities(Canvas, View); 82 DrawSelection(Canvas, View); 83 DrawArrows(Canvas, View); 79 84 if TGame(Game).DevelMode then DrawNeighborLinks(Canvas, View); 80 85 end; … … 305 310 MapCell: TCell; 306 311 CellText: string; 307 Points: array of Classes.TPoint;308 I: Integer;309 312 begin 310 313 with Canvas, View do begin … … 403 406 Cell: TPlayerCell; 404 407 MapCell: TCell; 405 CellText: string;406 408 Points: array of Classes.TPoint; 407 409 I: Integer; … … 454 456 procedure TClientGUI.DrawSelection(Canvas: TCanvas; View: TView); 455 457 var 456 Cell: TPlayerCell;457 MapCell: TCell;458 CellText: string;459 458 Points: array of Classes.TPoint; 460 459 I: Integer; … … 641 640 end; 642 641 642 procedure TView.ZoomAll; 643 var 644 Factor: TPointF; 645 MapRect: TRect; 646 NewZoom: Single; 647 begin 648 MapRect := TGame(Game).Map.CalculatePixelRect; 649 Factor := TPointF.Create(DestRect.Size.X / MapRect.Size.X, 650 DestRect.Size.Y / MapRect.Size.Y); 651 if Factor.X < Factor.Y then NewZoom := Factor.X 652 else NewZoom := Factor.Y; 653 if NewZoom = 0 then NewZoom := 1; 654 Zoom := NewZoom; 655 CenterMap; 656 end; 657 643 658 function TView.IsCellVisible(Cell: TCell): Boolean; 644 659 var
Note:
See TracChangeset
for help on using the changeset viewer.