Lazarus

Programming => General => Topic started by: PeterX on May 12, 2017, 12:31:06 pm

Title: [solved] Projects in C:\lazarus\examples - motiongraphics
Post by: PeterX on May 12, 2017, 12:31:06 pm
This is not a bugfix - simply makes it look better, to me ..

- on resizing the window ! -


Quote
procedure TForm1.FormPaint(Sender: TObject);
var
  lPoints: array[0..2] of TPoint;
begin
  lPoints[0].X := Self.Width  div 4;
  lPoints[0].Y := Self.Height div 4;
  lPoints[1].X := Self.Width  div 2;
  lPoints[1].Y := 0;
  lPoints[2].X := Self.Width  div 2;
  lPoints[2].Y := Self.Height div 2;
  ...


with additionally ..
Quote
function TForm1.RotatePoint(APoint, ACenter: TPoint; AAngle: Double): TPoint;
var
  dx, dy: Double;
begin
  dx := (ACenter.Y * Sin(AAngle)) - (ACenter.X * Cos(AAngle)) + ACenter.X +10;
  dy := -(ACenter.X * Sin(AAngle)) - (ACenter.Y * Cos(AAngle)) + ACenter.Y +Self.Height div 4;
  ...
Title: Re: Projects in C:\lazarus\examples - motiongraphics
Post by: wp on May 12, 2017, 12:48:25 pm
Done in r54877, together with a little refactoring to avoid multiple calculation of sin(AAngle) and cos(AAngle).
TinyPortal © 2005-2018