Changeset 269 for trunk/Forms/UFormClient.pas
- Timestamp:
- Jan 21, 2019, 12:38:20 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormClient.pas
r268 r269 106 106 FormClient: TFormClient; 107 107 108 const 109 MapBackgroundColor = $404040; 110 108 111 implementation 109 112 … … 180 183 X, Y: Integer; 181 184 TempView: TView; 182 const183 BackgroundColor = $404040;184 185 begin 185 186 DrawStart := Now; … … 189 190 if csOpaque in PaintBox1.ControlStyle then begin 190 191 TempBitmap.SetSize(PaintBox1.Width, PaintBox1.Height); 191 TempBitmap.Canvas.Brush.Color := BackGroundColor; //clBackground; //PaintBox1.GetColorResolvingParent;192 TempBitmap.Canvas.Brush.Color := MapBackGroundColor; //clBackground; //PaintBox1.GetColorResolvingParent; 192 193 TempBitmap.Canvas.FillRect(0, 0, PaintBox1.Width, PaintBox1.Height); 193 194 Client.Paint(TempBitmap.Canvas, View); … … 238 239 ) 239 240 ); 240 Client. Paint(PaintBox1.Canvas, TempView);241 Client.DrawCells(PaintBox1.Canvas, TempView); 241 242 end; 242 243 end; … … 291 292 end; 292 293 end else begin 293 Client.DrawCellLinks(PaintBox1.Canvas, View);294 294 Client.Paint(PaintBox1.Canvas, View); 295 Client.DrawCities(PaintBox1.Canvas, View);296 Client.DrawSelection(PaintBox1.Canvas, View);297 Client.DrawArrows(PaintBox1.Canvas, View);298 295 end; 299 296 end; … … 436 433 437 434 procedure TFormClient.AZoomAllExecute(Sender: TObject); 438 var439 Factor: TPointF;440 MapRect: TRect;441 NewZoom: Single;442 435 begin 443 436 with Core, Game, Client, View do begin 444 MapRect := Map.CalculatePixelRect; 445 Factor := TPointF.Create(DestRect.Size.X / MapRect.Size.X, 446 DestRect.Size.Y / MapRect.Size.Y); 447 if Factor.X < Factor.Y then NewZoom := Factor.X 448 else NewZoom := Factor.Y; 449 if NewZoom = 0 then NewZoom := 1; 450 Zoom := NewZoom; 451 CenterMap; 437 ZoomAll; 452 438 end; 453 439 Redraw;
Note:
See TracChangeset
for help on using the changeset viewer.