|
@@ -174,15 +174,12 @@ end;
|
|
|
|
|
|
procedure TEllipseInfo.GatherEllipseInfo (const bounds:TRect);
|
|
procedure TEllipseInfo.GatherEllipseInfo (const bounds:TRect);
|
|
var infoP, infoM : PEllipseInfoData;
|
|
var infoP, infoM : PEllipseInfoData;
|
|
- halfnumber,
|
|
|
|
r, NumberPixels, xtemp,yt,yb : integer;
|
|
r, NumberPixels, xtemp,yt,yb : integer;
|
|
- pPy, pMy, x,y, rx,ry, xd,yd,ra, rdelta : real;
|
|
|
|
|
|
+ x,y, rx,ry, xd,yd,ra, rdelta : real;
|
|
ras,rac : single;
|
|
ras,rac : single;
|
|
-
|
|
|
|
begin
|
|
begin
|
|
ClearList;
|
|
ClearList;
|
|
CalculateCircular (bounds, x,y,rx,ry);
|
|
CalculateCircular (bounds, x,y,rx,ry);
|
|
- with bounds do
|
|
|
|
fcx := x;
|
|
fcx := x;
|
|
fcy := y;
|
|
fcy := y;
|
|
frx := rx;
|
|
frx := rx;
|
|
@@ -198,9 +195,6 @@ begin
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
PrepareCalculation (NumberPixels, rdelta);
|
|
PrepareCalculation (NumberPixels, rdelta);
|
|
- halfnumber := NumberPixels div 2;
|
|
|
|
- pPy := maxint;
|
|
|
|
- pMy := maxint;
|
|
|
|
ra := 0;
|
|
ra := 0;
|
|
infoP := NewInfoRec (round(x + rx));
|
|
infoP := NewInfoRec (round(x + rx));
|
|
infoM := NewInfoRec (round(x - rx));
|
|
infoM := NewInfoRec (round(x - rx));
|
|
@@ -216,26 +210,6 @@ begin
|
|
// quarter 1 and 4 at the same x line
|
|
// quarter 1 and 4 at the same x line
|
|
if infoP^.x <> xtemp then // has correct record ?
|
|
if infoP^.x <> xtemp then // has correct record ?
|
|
begin
|
|
begin
|
|
- with infoP^ do // ensure single width
|
|
|
|
- begin
|
|
|
|
- if r < halfnumber then
|
|
|
|
- begin
|
|
|
|
- if ytopmin = yt then
|
|
|
|
- begin
|
|
|
|
- inc (ytopmin);
|
|
|
|
- dec (ybotmax);
|
|
|
|
- end;
|
|
|
|
- end
|
|
|
|
- else
|
|
|
|
- begin
|
|
|
|
- if (ytopmax = pPy) and (ytopmax <> ytopmin) then
|
|
|
|
- begin
|
|
|
|
- dec (ytopmax);
|
|
|
|
- inc (ybotmin);
|
|
|
|
- end;
|
|
|
|
- end;
|
|
|
|
- pPy := ytopmin;
|
|
|
|
- end;
|
|
|
|
if not GetInfoForX (xtemp, infoP) then // record exists already ?
|
|
if not GetInfoForX (xtemp, infoP) then // record exists already ?
|
|
infoP := NewInfoRec (xtemp); // create a new recod
|
|
infoP := NewInfoRec (xtemp); // create a new recod
|
|
end;
|
|
end;
|
|
@@ -255,26 +229,6 @@ begin
|
|
xtemp := round(x - xd);
|
|
xtemp := round(x - xd);
|
|
if infoM^.x <> xtemp then // has correct record ?
|
|
if infoM^.x <> xtemp then // has correct record ?
|
|
begin
|
|
begin
|
|
- with infoM^ do // ensure single width
|
|
|
|
- begin
|
|
|
|
- if r < halfnumber then
|
|
|
|
- begin
|
|
|
|
- if ytopmin = yt then
|
|
|
|
- begin
|
|
|
|
- inc (ytopmin);
|
|
|
|
- dec (ybotmax);
|
|
|
|
- end;
|
|
|
|
- end
|
|
|
|
- else
|
|
|
|
- begin
|
|
|
|
- if (ytopmax = pMy) and (ytopmax <> ytopmin) then
|
|
|
|
- begin
|
|
|
|
- dec (ytopmax);
|
|
|
|
- inc (ybotmin);
|
|
|
|
- end;
|
|
|
|
- end;
|
|
|
|
- pMy := ytopmin;
|
|
|
|
- end;
|
|
|
|
if not GetInfoForX (xtemp, infoM) then // record exists already ?
|
|
if not GetInfoForX (xtemp, infoM) then // record exists already ?
|
|
infoM := NewInfoRec (xtemp); // create a new recod
|
|
infoM := NewInfoRec (xtemp); // create a new recod
|
|
end;
|
|
end;
|
|
@@ -371,9 +325,10 @@ end;
|
|
|
|
|
|
procedure DrawSolidEllipse (Canv:TFPCustomCanvas; const Bounds:TRect; Width:integer; const c:TFPColor);
|
|
procedure DrawSolidEllipse (Canv:TFPCustomCanvas; const Bounds:TRect; Width:integer; const c:TFPColor);
|
|
var infoOut, infoIn : TEllipseInfo;
|
|
var infoOut, infoIn : TEllipseInfo;
|
|
- r, y : integer;
|
|
|
|
|
|
+ r, y, dw : integer;
|
|
id : PEllipseInfoData;
|
|
id : PEllipseInfoData;
|
|
MyPutPix : TPutPixelProc;
|
|
MyPutPix : TPutPixelProc;
|
|
|
|
+ rct: TRect;
|
|
begin
|
|
begin
|
|
with canv.pen do
|
|
with canv.pen do
|
|
case mode of
|
|
case mode of
|
|
@@ -384,12 +339,15 @@ begin
|
|
end;
|
|
end;
|
|
infoIn := TEllipseInfo.Create;
|
|
infoIn := TEllipseInfo.Create;
|
|
infoOut := TEllipseInfo.Create;
|
|
infoOut := TEllipseInfo.Create;
|
|
- dec (width);
|
|
|
|
|
|
+ dec(Width);
|
|
|
|
+ dw := Width div 2;
|
|
id:=Nil;
|
|
id:=Nil;
|
|
try
|
|
try
|
|
- infoOut.GatherEllipseInfo(bounds);
|
|
|
|
- with bounds do
|
|
|
|
- infoIn.GatherEllipseInfo (Rect(left+width,top+width,right-width,bottom-width));
|
|
|
|
|
|
+ rct := bounds;
|
|
|
|
+ rct.Inflate(dw, dw);
|
|
|
|
+ infoOut.GatherEllipseInfo(rct);
|
|
|
|
+ rct.Inflate(-Width, -Width);
|
|
|
|
+ infoIn.GatherEllipseInfo(rct);
|
|
with Canv do
|
|
with Canv do
|
|
for r := 0 to infoOut.infolist.count-1 do
|
|
for r := 0 to infoOut.infolist.count-1 do
|
|
with PEllipseInfoData (infoOut.infolist[r])^ do
|
|
with PEllipseInfoData (infoOut.infolist[r])^ do
|