From 7414f68f5bdf0f67c0deacd9f7fa9b8baba3bd55 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Wed, 15 Nov 2023 10:18:03 +0000 Subject: [PATCH] industrial: Fix compilation with Laz versions before 3.0 git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9028 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/industrialstuff/source/switches.pas | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/components/industrialstuff/source/switches.pas b/components/industrialstuff/source/switches.pas index 592419a41..fd7abd559 100644 --- a/components/industrialstuff/source/switches.pas +++ b/components/industrialstuff/source/switches.pas @@ -18,7 +18,7 @@ unit Switches; interface uses - LCLIntf, LCLType, LMessages, + LCLIntf, LCLType, LMessages, LCLVersion, Graphics, GraphType, Classes, SysUtils, Types, Controls, ExtCtrls, ImgList; type @@ -244,6 +244,17 @@ begin end; end; +{$IF LCL_FullVersion < 3000000} +function RotatePoint(const APoint: TPoint; AAngle: Double): TPoint; +var + sa, ca: Double; +begin + SinCos(AAngle, sa, ca); + Result.X := Round( ca * APoint.X + sa * APoint.Y); + Result.Y := Round(-sa * APoint.X + ca * APoint.Y); +end; +{$ENDIF} + procedure RotateImage(Img: TFPCustomImage; Angle: Double); var Buffer: TFPCustomImage;