From b21a3243d559fc789816b80e0caed1951e3a5f87 Mon Sep 17 00:00:00 2001 From: wp_xyz Date: Wed, 9 Jul 2025 18:31:49 +0200 Subject: [PATCH] Revert "LCL/Graphics: Fix win32 WS not drawing incomplete continuous Bezier segments in PolyBezier. Do not copy points in overloaded procedure." This reverts commit 12799e965a7e00716c492591ce6a55c85af1b2ba. --- lcl/include/canvas.inc | 12 ++++++++++-- lcl/interfaces/win32/win32winapi.inc | 5 ----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lcl/include/canvas.inc b/lcl/include/canvas.inc index 7497de9e74..04adda5163 100644 --- a/lcl/include/canvas.inc +++ b/lcl/include/canvas.inc @@ -840,11 +840,19 @@ end; procedure TCanvas.PolyBezier(const Points: array of TPoint; Filled: boolean = False; Continuous: boolean = True); -var NPoints: integer; +var NPoints, i: integer; + PointArray: ^TPoint; begin NPoints:=High(Points)-Low(Points)+1; if NPoints<4 then exit; // Curve must have at least 4 points - PolyBezier(@Points[0], NPoints, Filled, Continuous); + GetMem(PointArray,SizeOf(TPoint)*NPoints); + try + for i:=0 to NPoints-1 do + PointArray[i]:=Points[i+Low(Points)]; + PolyBezier(PointArray, NPoints, Filled, Continuous); + finally + FreeMem(PointArray); + end; end; procedure TCanvas.PolyBezier(Points: PPoint; NumPts: Integer; diff --git a/lcl/interfaces/win32/win32winapi.inc b/lcl/interfaces/win32/win32winapi.inc index da900a0c9e..a5d8b2305a 100644 --- a/lcl/interfaces/win32/win32winapi.inc +++ b/lcl/interfaces/win32/win32winapi.inc @@ -2852,12 +2852,7 @@ begin If Filled or (not Continuous) then Result := Inherited PolyBezier(DC,Points,NumPts, Filled, Continuous) else - begin - // Make sure that only complete bezier segments are included in this mode. - // Otherwise, Windows will not draw anything at all. - NumPts := (NumPts - 1) div 3 * 3 + 1; Result := Boolean(Windows.PolyBezier(DC, LPPOINT(Points)^, NumPts)); - end; end; {------------------------------------------------------------------------------