mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 19:39:30 +02:00
Qt,Qt5: fixed radialPie paint with antialiasing. issue #39416
This commit is contained in:
parent
1f1239bb7a
commit
c822e57876
@ -430,12 +430,20 @@ end; {TQtWidgetSet.PromptUser}
|
||||
function TQtWidgetSet.RadialPie(DC: HDC; x1, y1, x2, y2, Angle1, Angle2: Integer): Boolean;
|
||||
var
|
||||
theWidth,theHeight: Integer;
|
||||
ARect: QRectFH;
|
||||
begin
|
||||
Result := IsValidDC(DC) and (x2 > x1) and (y2 > y1);
|
||||
if Result then begin
|
||||
if Result then
|
||||
begin
|
||||
theWidth := x2 - x1;
|
||||
theHeight := y2 - y1;
|
||||
QPainter_drawPie(TQtDeviceContext(DC).Widget, x1, y1, theWidth, theHeight, Angle1, Angle2);
|
||||
if QPainter_testRenderHint(TQtDeviceContext(DC).Widget, QPainterAntialiasing) then
|
||||
begin
|
||||
ARect := QRectF_Create(x1 + 0.5, y1 + 0.5, theWidth - 0.5, theHeight - 0.5);
|
||||
QPainter_drawPie(TQtDeviceContext(DC).Widget, ARect, Angle1, Angle2);
|
||||
QRectF_destroy(ARect);
|
||||
end else
|
||||
QPainter_drawPie(TQtDeviceContext(DC).Widget, x1, y1, theWidth, theHeight, Angle1, Angle2);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -759,7 +759,7 @@ begin
|
||||
Result := HRGN(QtRegion);
|
||||
{$ifdef VerboseQtWinAPI}
|
||||
WriteLn('Trace: [WinAPI CreateRectRgn] Result: ', dbghex(Result),
|
||||
' QRegionH: ', dbghex(PtrInt(QtRegion.Widget)));
|
||||
' QRegionH: ', dbghex(PtrInt(QtRegion.FHandle)));
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
@ -2760,7 +2760,7 @@ begin
|
||||
' DC: ', dbghex(DC),
|
||||
' RGN: ', dbghex(Rgn));
|
||||
if RGN<>0 then
|
||||
WriteLn(' QRegionH=', PtrInt(TQtRegion(Rgn).Widget))
|
||||
WriteLn(' QRegionH=', PtrInt(TQtRegion(Rgn).FHandle))
|
||||
else
|
||||
WriteLn(' Rgn=0');
|
||||
{$endif}
|
||||
@ -5439,6 +5439,7 @@ function TQtWidgetSet.Polygon(DC: HDC; Points: PPoint; NumPts: Integer;
|
||||
Winding: boolean): boolean;
|
||||
var
|
||||
QtPoints: PQtPoint;
|
||||
QtPointsF: PQtPointF;
|
||||
i: integer;
|
||||
begin
|
||||
{$ifdef VerboseQtWinAPI}
|
||||
|
@ -428,12 +428,20 @@ end; {TQtWidgetSet.PromptUser}
|
||||
function TQtWidgetSet.RadialPie(DC: HDC; x1, y1, x2, y2, Angle1, Angle2: Integer): Boolean;
|
||||
var
|
||||
theWidth,theHeight: Integer;
|
||||
ARect: QRectFH;
|
||||
begin
|
||||
Result := IsValidDC(DC) and (x2 > x1) and (y2 > y1);
|
||||
if Result then begin
|
||||
if Result then
|
||||
begin
|
||||
theWidth := x2 - x1;
|
||||
theHeight := y2 - y1;
|
||||
QPainter_drawPie(TQtDeviceContext(DC).Widget, x1, y1, theWidth, theHeight, Angle1, Angle2);
|
||||
if QPainter_testRenderHint(TQtDeviceContext(DC).Widget, QPainterAntialiasing) then
|
||||
begin
|
||||
ARect := QRectF_Create(x1 + 0.5, y1 + 0.5, theWidth - 0.5, theHeight - 0.5);
|
||||
QPainter_drawPie(TQtDeviceContext(DC).Widget, ARect, Angle1, Angle2);
|
||||
QRectF_destroy(ARect);
|
||||
end else
|
||||
QPainter_drawPie(TQtDeviceContext(DC).Widget, x1, y1, theWidth, theHeight, Angle1, Angle2);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -751,7 +751,7 @@ begin
|
||||
Result := HRGN(TQtRegion.Create(True, X1, Y1, X2, Y2));
|
||||
{$ifdef VerboseQtWinAPI}
|
||||
WriteLn('Trace: [WinAPI CreateRectRgn] Result: ', dbghex(Result),
|
||||
' QRegionH: ', dbghex(PtrUInt(TQtRegion(Result).Widget)));
|
||||
' QRegionH: ', dbghex(PtrUInt(TQtRegion(Result).FHandle)));
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
@ -2703,7 +2703,7 @@ begin
|
||||
' DC: ', dbghex(DC),
|
||||
' RGN: ', dbghex(Rgn));
|
||||
if RGN<>0 then
|
||||
WriteLn(' QRegionH=', PtrInt(TQtRegion(Rgn).Widget))
|
||||
WriteLn(' QRegionH=', PtrInt(TQtRegion(Rgn).FHandle))
|
||||
else
|
||||
WriteLn(' Rgn=0');
|
||||
{$endif}
|
||||
|
Loading…
Reference in New Issue
Block a user