Cause of sometimes 'invalid floating point' message
This commit is contained in:
parent
c9b167ae79
commit
b53b214b20
@ -57,6 +57,9 @@ object AdjustForm: TAdjustForm
|
|||||||
BevelOuter = bvLowered
|
BevelOuter = bvLowered
|
||||||
Color = clAppWorkSpace
|
Color = clAppWorkSpace
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
|
DesignSize = (
|
||||||
|
162
|
||||||
|
122)
|
||||||
object PreviewImage: TImage
|
object PreviewImage: TImage
|
||||||
Left = 1
|
Left = 1
|
||||||
Top = 1
|
Top = 1
|
||||||
@ -312,7 +315,6 @@ object AdjustForm: TAdjustForm
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
object ColorDialog: TColorDialog
|
object ColorDialog: TColorDialog
|
||||||
Ctl3D = True
|
|
||||||
Options = [cdFullOpen]
|
Options = [cdFullOpen]
|
||||||
Left = 376
|
Left = 376
|
||||||
Top = 8
|
Top = 8
|
||||||
|
@ -157,8 +157,13 @@ begin
|
|||||||
scrollBrightness.Position := trunc(cp.Brightness * 100);
|
scrollBrightness.Position := trunc(cp.Brightness * 100);
|
||||||
scrollVibrancy.Position := trunc(cp.vibrancy * 100);
|
scrollVibrancy.Position := trunc(cp.vibrancy * 100);
|
||||||
scrollZoom.Position := trunc(cp.zoom * 100);
|
scrollZoom.Position := trunc(cp.zoom * 100);
|
||||||
scrollCenterX.Position := trunc(cp.Center[0] * 100);
|
if (abs(cp.Center[0]) < 1000) and (abs(cp.Center[0]) < 1000) then begin
|
||||||
scrollCenterY.Position := trunc(cp.Center[1] * 100);
|
scrollCenterX.Position := trunc(cp.Center[0] * 100);
|
||||||
|
scrollCenterY.Position := trunc(cp.Center[1] * 100);
|
||||||
|
end else begin
|
||||||
|
scrollCenterX.Position := 0;
|
||||||
|
scrollCenterY.Position := 0;
|
||||||
|
end;
|
||||||
ColorPanel.color := cp.background[2] shl 16 +
|
ColorPanel.color := cp.background[2] shl 16 +
|
||||||
cp.background[1] shl 8 + cp.background[0];
|
cp.background[1] shl 8 + cp.background[0];
|
||||||
Resetting := False;
|
Resetting := False;
|
||||||
|
@ -878,18 +878,17 @@ begin
|
|||||||
xform[i].vars[j] := 0;
|
xform[i].vars[j] := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if rv < 0 then
|
if rv < 0 then begin
|
||||||
begin
|
|
||||||
repeat
|
repeat
|
||||||
v := Mixed_var_distrib[random(Length(mixed_var_distrib))];
|
v := Mixed_var_distrib[random(Length(mixed_var_distrib))];
|
||||||
until Variations[v]; // use only variations set in options
|
until Variations[v]; // use only variations set in options
|
||||||
xform[i].vars[v] := 1
|
xform[i].vars[v] := 1
|
||||||
end
|
end else
|
||||||
else
|
|
||||||
xform[i].vars[rv] := 1;
|
xform[i].vars[rv] := 1;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
if calc then CalcBoundbox;
|
if calc then
|
||||||
|
CalcBoundbox;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TControlPoint.RandomCP1;
|
procedure TControlPoint.RandomCP1;
|
||||||
@ -927,10 +926,10 @@ begin
|
|||||||
|
|
||||||
LimitOutSidePoints := Round(0.05 * SUB_BATCH_SIZE);
|
LimitOutSidePoints := Round(0.05 * SUB_BATCH_SIZE);
|
||||||
|
|
||||||
minx := 1E10;
|
minx := 1E99;
|
||||||
maxx := -1E10;
|
maxx := -1E99;
|
||||||
miny := 1E10;
|
miny := 1E99;
|
||||||
maxy := -1E10;
|
maxy := -1E99;
|
||||||
for i := 0 to SUB_BATCH_SIZE - 1 do begin
|
for i := 0 to SUB_BATCH_SIZE - 1 do begin
|
||||||
minx := min(minx, Points[i].x);
|
minx := min(minx, Points[i].x);
|
||||||
maxx := max(maxx, Points[i].x);
|
maxx := max(maxx, Points[i].x);
|
||||||
@ -986,6 +985,11 @@ begin
|
|||||||
|
|
||||||
deltay := deltay / 2;
|
deltay := deltay / 2;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if ((maxx - minx) > 1000) or
|
||||||
|
((maxy - miny) > 1000) then
|
||||||
|
raise Exception.Create('Flame area to large');
|
||||||
|
|
||||||
center[0] := (minx + maxx) / 2;
|
center[0] := (minx + maxx) / 2;
|
||||||
center[1] := (miny + maxy) / 2;
|
center[1] := (miny + maxy) / 2;
|
||||||
if ((maxx - minx) > 0.001) and ((maxy - miny) > 0.001) then
|
if ((maxx - minx) > 0.001) and ((maxy - miny) > 0.001) then
|
||||||
@ -1018,10 +1022,10 @@ begin
|
|||||||
|
|
||||||
LimitOutSidePoints := Round(0.05 * SUB_BATCH_SIZE);
|
LimitOutSidePoints := Round(0.05 * SUB_BATCH_SIZE);
|
||||||
|
|
||||||
minx := 1E10;
|
minx := 1E99;
|
||||||
maxx := -1E10;
|
maxx := -1E99;
|
||||||
miny := 1E10;
|
miny := 1E99;
|
||||||
maxy := -1E10;
|
maxy := -1E99;
|
||||||
for i := 0 to SUB_BATCH_SIZE - 1 do begin
|
for i := 0 to SUB_BATCH_SIZE - 1 do begin
|
||||||
minx := min(minx, Points[i].x);
|
minx := min(minx, Points[i].x);
|
||||||
maxx := max(maxx, Points[i].x);
|
maxx := max(maxx, Points[i].x);
|
||||||
@ -1077,6 +1081,11 @@ begin
|
|||||||
|
|
||||||
deltay := deltay / 2;
|
deltay := deltay / 2;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if ((maxx - minx) > 1000) or
|
||||||
|
((maxy - miny) > 1000) then
|
||||||
|
raise Exception.Create('Flame area to large');
|
||||||
|
|
||||||
cp.center[0] := (minx + maxx) / 2;
|
cp.center[0] := (minx + maxx) / 2;
|
||||||
cp.center[1] := (miny + maxy) / 2;
|
cp.center[1] := (miny + maxy) / 2;
|
||||||
if ((maxx - minx) > 0.001) and ((maxy - miny) > 0.001) then
|
if ((maxx - minx) > 0.001) and ((maxy - miny) > 0.001) then
|
||||||
@ -1097,7 +1106,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
except on E: EMathError do
|
except on E: EMathError do
|
||||||
raise Exception.Create('CalcUPRMagn: ' +e.Message);
|
begin// default
|
||||||
|
cp.center[0] := 0;
|
||||||
|
cp.center[1] := 0;
|
||||||
|
cp.pixels_per_unit := 10;
|
||||||
|
raise Exception.Create('CalcUPRMagn: ' +e.Message);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user