* Patch from Werner Pamler to implement FillEllipsePattern. Fixes issue #40282

This commit is contained in:
Michaël Van Canneyt 2023-05-22 22:46:43 +02:00
parent be54d40660
commit 02b6e9143a

View File

@ -489,7 +489,36 @@ begin
end;
procedure FillEllipsePattern (Canv:TFPCustomCanvas; const Bounds:TRect; Pattern:TBrushPattern; const c:TFPColor);
var info : TEllipseInfo;
r, y : integer;
pixNo: Byte;
pixVal: TPenPattern;
patt: TPenPattern;
pattHeight: Integer;
infoData: PEllipseInfoData;
begin
info := TEllipseInfo.Create;
try
info.GatherEllipseInfo(bounds);
pattHeight := Length(Pattern);
for r := 0 to info.infolist.count-1 do
begin
infoData := PEllipseInfoData(info.infolist[r]);
with infoData^ do
begin
pixNo := x mod PatternBitCount;
pixVal := 1 shl pixNo;
for y := ytopmin to ybotmax do
begin
patt := Pattern[y mod pattHeight];
if patt and pixVal <> 0 then
canv.DrawPixel(x, y, c);
end;
end;
end;
finally
info.Free;
end;
end;
procedure FillEllipseHashHorizontal (Canv:TFPCustomCanvas; const Bounds:TRect; width:integer; const c:TFPColor);