added new constant MAX_WEIGHT
This commit is contained in:
parent
8e035eac58
commit
8121918b55
@ -706,7 +706,7 @@ object EditForm: TEditForm
|
|||||||
Top = 134
|
Top = 134
|
||||||
Width = 23
|
Width = 23
|
||||||
Height = 24
|
Height = 24
|
||||||
Hint = 'Scale triangle'
|
Hint = 'Scale triangle up'
|
||||||
Flat = True
|
Flat = True
|
||||||
Glyph.Data = {
|
Glyph.Data = {
|
||||||
F6000000424DF600000000000000760000002800000010000000100000000100
|
F6000000424DF600000000000000760000002800000010000000100000000100
|
||||||
@ -726,7 +726,7 @@ object EditForm: TEditForm
|
|||||||
Top = 134
|
Top = 134
|
||||||
Width = 23
|
Width = 23
|
||||||
Height = 24
|
Height = 24
|
||||||
Hint = 'UnScale triangle'
|
Hint = 'Scale triangle down'
|
||||||
Flat = True
|
Flat = True
|
||||||
Glyph.Data = {
|
Glyph.Data = {
|
||||||
F6000000424DF600000000000000760000002800000010000000100000000100
|
F6000000424DF600000000000000760000002800000010000000100000000100
|
||||||
|
@ -2432,7 +2432,6 @@ begin
|
|||||||
else if Sender = txtP then
|
else if Sender = txtP then
|
||||||
begin
|
begin
|
||||||
cp.xform[SelectedTriangle].density := StrToFloat(TEdit(Sender).Text);
|
cp.xform[SelectedTriangle].density := StrToFloat(TEdit(Sender).Text);
|
||||||
//ReadjustWeights(cp);
|
|
||||||
TEdit(Sender).Text := Format('%.6g', [cp.xform[SelectedTriangle].density]);
|
TEdit(Sender).Text := Format('%.6g', [cp.xform[SelectedTriangle].density]);
|
||||||
end;
|
end;
|
||||||
MainForm.UpdateUndo;
|
MainForm.UpdateUndo;
|
||||||
@ -2494,7 +2493,6 @@ begin
|
|||||||
else if Sender = txtP then
|
else if Sender = txtP then
|
||||||
begin
|
begin
|
||||||
cp.xform[SelectedTriangle].density := StrToFloat(TEdit(Sender).Text);
|
cp.xform[SelectedTriangle].density := StrToFloat(TEdit(Sender).Text);
|
||||||
//ReadjustWeights(cp);
|
|
||||||
TEdit(Sender).Text := Format('%.6g', [cp.xform[SelectedTriangle].density]);
|
TEdit(Sender).Text := Format('%.6g', [cp.xform[SelectedTriangle].density]);
|
||||||
end;
|
end;
|
||||||
MainForm.UpdateUndo;
|
MainForm.UpdateUndo;
|
||||||
@ -2529,7 +2527,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
NewVal := Round6(StrToFloat(TEdit(Sender).Text));
|
NewVal := Round6(StrToFloat(TEdit(Sender).Text));
|
||||||
if NewVal < 0.000001 then NewVal := 0.000001;
|
if NewVal < 0.000001 then NewVal := 0.000001;
|
||||||
if NewVal > 100 then NewVal := 100;
|
if NewVal > MAX_WEIGHT then NewVal := MAX_WEIGHT;
|
||||||
{ If it's not the same as the old value and it was valid }
|
{ If it's not the same as the old value and it was valid }
|
||||||
TEdit(Sender).Text := Format('%.6g', [NewVal]);
|
TEdit(Sender).Text := Format('%.6g', [NewVal]);
|
||||||
if (OldVal <> NewVal) and Allow then
|
if (OldVal <> NewVal) and Allow then
|
||||||
@ -2561,7 +2559,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
NewVal := Round6(StrToFloat(TEdit(Sender).Text));
|
NewVal := Round6(StrToFloat(TEdit(Sender).Text));
|
||||||
if NewVal < 0.000001 then NewVal := 0.000001;
|
if NewVal < 0.000001 then NewVal := 0.000001;
|
||||||
if NewVal > 100 then NewVal := 100;
|
if NewVal > MAX_WEIGHT then NewVal := MAX_WEIGHT;
|
||||||
{ If it's not the same as the old value and it was valid }
|
{ If it's not the same as the old value and it was valid }
|
||||||
TEdit(Sender).Text := Format('%.6g', [NewVal]);
|
TEdit(Sender).Text := Format('%.6g', [NewVal]);
|
||||||
if (OldVal <> NewVal) and Allow then
|
if (OldVal <> NewVal) and Allow then
|
||||||
@ -4342,7 +4340,8 @@ begin
|
|||||||
|
|
||||||
if (Sender = pnlWeight) then
|
if (Sender = pnlWeight) then
|
||||||
begin
|
begin
|
||||||
if v <= 0.000001 then v := 0.000001;
|
if v <= 0.000001 then v := 0.000001
|
||||||
|
else if v > MAX_WEIGHT then v := MAX_WEIGHT;
|
||||||
cp.xform[SelectedTriangle].density := v;
|
cp.xform[SelectedTriangle].density := v;
|
||||||
pEdit := @txtP;
|
pEdit := @txtP;
|
||||||
end
|
end
|
||||||
|
@ -5,6 +5,9 @@ interface
|
|||||||
uses
|
uses
|
||||||
XFormMan, BaseVariation;
|
XFormMan, BaseVariation;
|
||||||
|
|
||||||
|
const
|
||||||
|
MAX_WEIGHT = 1000.0;
|
||||||
|
|
||||||
type
|
type
|
||||||
TCPpoint = record
|
TCPpoint = record
|
||||||
x, y, c: double;
|
x, y, c: double;
|
||||||
|
Loading…
Reference in New Issue
Block a user