Changeset 234 for trunk/UClientGUI.pas
- Timestamp:
- Sep 19, 2018, 5:28:58 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UClientGUI.pas
r233 r234 347 347 function TView.CanvasToCellPos(Pos: TPoint): TPoint; 348 348 begin 349 Result := TPoint.Create(Trunc( Pos.X/ Zoom + SourceRect.P1.X),350 Trunc( Pos.Y/ Zoom + SourceRect.P1.Y));349 Result := TPoint.Create(Trunc((Pos.X - DestRect.P1.X) / Zoom + SourceRect.P1.X), 350 Trunc((Pos.Y - DestRect.P1.Y) / Zoom + SourceRect.P1.Y)); 351 351 end; 352 352 353 353 function TView.CellToCanvasPos(Pos: TPoint): TPoint; 354 354 begin 355 Result := TPoint.Create(Trunc((Pos.X - SourceRect.P1.X) * Zoom) ,356 Trunc((Pos.Y - SourceRect.P1.Y) * Zoom) );355 Result := TPoint.Create(Trunc((Pos.X - SourceRect.P1.X) * Zoom) + DestRect.P1.X, 356 Trunc((Pos.Y - SourceRect.P1.Y) * Zoom) + DestRect.P1.Y); 357 357 end; 358 358 … … 449 449 (RectPolygon.P2.Y > RectView.P1.Y) 450 450 ); 451 Result := True; 451 452 end; 452 453
Note:
See TracChangeset
for help on using the changeset viewer.