From b2fd1f356f984456883f2a6741c87fa068ae77f2 Mon Sep 17 00:00:00 2001 From: Henrique Gottardi Werlang Date: Thu, 13 Feb 2025 11:28:29 -0300 Subject: [PATCH] Was forgotten about dotted units. --- packages/rtl/src/sysutils.pas | 2 +- packages/rtl/src/types.pas | 4 ++++ packages/rtl/src/web.pas | 25 ++++++++++++++----------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/packages/rtl/src/sysutils.pas b/packages/rtl/src/sysutils.pas index c391039..cffb05f 100644 --- a/packages/rtl/src/sysutils.pas +++ b/packages/rtl/src/sysutils.pas @@ -3076,7 +3076,7 @@ end; constructor EJSException.create(aJSError: TJSError); begin - Inherited CreateFmt('Javascript %s exception : %s',[JS.JSClassName(aJSError),aJSError.Message]); + Inherited CreateFmt('Javascript %s exception : %s',[{$IFDEF FPC_DOTTEDUNITS}JSApi.{$ENDIF}JS.JSClassName(aJSError),aJSError.Message]); end; Const diff --git a/packages/rtl/src/types.pas b/packages/rtl/src/types.pas index 3f97e41..3df5c2f 100644 --- a/packages/rtl/src/types.pas +++ b/packages/rtl/src/types.pas @@ -441,7 +441,11 @@ function UnionRectF(out Rect: TRectF; const R1, R2: TRectF): Boolean; implementation +{$IFDEF FPC_DOTTEDUNITS} +uses System.Math; +{$ELSE FPC_DOTTEDUNITS} uses math; +{$ENDIF FPC_DOTTEDUNITS} function RectCenter(var R: TRect; const Bounds: TRect): TRect; diff --git a/packages/rtl/src/web.pas b/packages/rtl/src/web.pas index 7efbe3c..b9de8da 100644 --- a/packages/rtl/src/web.pas +++ b/packages/rtl/src/web.pas @@ -124,6 +124,13 @@ Type TJSPermissions = BrowserApi.WebOrWorker.TJSPermissions; TJSRequest = BrowserApi.WebOrWorker.TJSRequest; TJSPerformance = BrowserApi.WebOrWorker.TJSPerformance; + TCanvasCoordType = BrowserApi.WebOrWorker.TCanvasCoordType; + TJSCanvasGradient = BrowserApi.WebOrWorker.TJSCanvasGradient; + TJSCanvasPattern = BrowserApi.WebOrWorker.TJSCanvasPattern; + TJSPath2D = BrowserApi.WebOrWorker.TJSPath2D; + TJSImageBitmap = BrowserApi.WebOrWorker.TJSImageBitmap; + TJSOffscreenCanvasRenderingContext2D = BrowserApi.WebOrWorker.TJSOffscreenCanvasRenderingContext2D; + TJSHTMLOffscreenCanvasElement = BrowserApi.WebOrWorker.TJSHTMLOffscreenCanvas; {$ELSE} TJSServiceWorker = weborworker.TJSServiceWorker; TJSServiceWorkerRegistration = weborworker.TJSServiceWorkerRegistration; @@ -197,6 +204,13 @@ Type TJSRequest = webOrworker.TJSRequest; TJSAbortController = webOrworker.TJSAbortController; TJSPerformance = WebOrWorker.TJSPerformance; + TCanvasCoordType = weborworker.TCanvasCoordType; + TJSCanvasGradient = weborworker.TJSCanvasGradient; + TJSCanvasPattern = weborworker.TJSCanvasPattern; + TJSPath2D = weborworker.TJSPath2D; + TJSImageBitmap = weborworker.TJSImageBitmap; + TJSOffscreenCanvasRenderingContext2D = weborworker.TJSOffscreenCanvasRenderingContext2D; + TJSHTMLOffscreenCanvasElement = weborworker.TJSHTMLOffscreenCanvas; {$ENDIF} TJSMessagePortArray = TJSMessagePortDynArray; TEventListenerEvent = TJSEvent; @@ -2547,11 +2561,6 @@ Type end; - TCanvasCoordType = weborworker.TCanvasCoordType; - - TJSCanvasGradient = weborworker.TJSCanvasGradient; - TJSCanvasPattern = weborworker.TJSCanvasPattern; - TJSPath2D = weborworker.TJSPath2D; TJSCanvasRenderingContext2D = class external name 'CanvasRenderingContext2D' (TJSBaseCanvasRenderingContext2D) private FCanvas: TJSHTMLCanvasElement; external name 'canvas'; @@ -2562,12 +2571,6 @@ Type end; - TJSImageBitmap = weborworker.TJSImageBitmap; - TJSOffscreenCanvasRenderingContext2D = weborworker.TJSOffscreenCanvasRenderingContext2D; - TJSHTMLOffscreenCanvasElement = weborworker.TJSHTMLOffscreenCanvas; - - - { TJSHTMLIFrameElement } TJSHTMLIFrameElement = Class external name 'HTMLIFrameElement' (TJSHTMLElement)