added new constant MAX_WEIGHT

This commit is contained in:
zueuk 2006-12-09 14:42:02 +00:00
parent 8e035eac58
commit 8121918b55
3 changed files with 9 additions and 7 deletions

View File

@ -706,7 +706,7 @@ object EditForm: TEditForm
Top = 134
Width = 23
Height = 24
Hint = 'Scale triangle'
Hint = 'Scale triangle up'
Flat = True
Glyph.Data = {
F6000000424DF600000000000000760000002800000010000000100000000100
@ -726,7 +726,7 @@ object EditForm: TEditForm
Top = 134
Width = 23
Height = 24
Hint = 'UnScale triangle'
Hint = 'Scale triangle down'
Flat = True
Glyph.Data = {
F6000000424DF600000000000000760000002800000010000000100000000100

View File

@ -2432,7 +2432,6 @@ begin
else if Sender = txtP then
begin
cp.xform[SelectedTriangle].density := StrToFloat(TEdit(Sender).Text);
//ReadjustWeights(cp);
TEdit(Sender).Text := Format('%.6g', [cp.xform[SelectedTriangle].density]);
end;
MainForm.UpdateUndo;
@ -2494,7 +2493,6 @@ begin
else if Sender = txtP then
begin
cp.xform[SelectedTriangle].density := StrToFloat(TEdit(Sender).Text);
//ReadjustWeights(cp);
TEdit(Sender).Text := Format('%.6g', [cp.xform[SelectedTriangle].density]);
end;
MainForm.UpdateUndo;
@ -2529,7 +2527,7 @@ begin
end;
NewVal := Round6(StrToFloat(TEdit(Sender).Text));
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 }
TEdit(Sender).Text := Format('%.6g', [NewVal]);
if (OldVal <> NewVal) and Allow then
@ -2561,7 +2559,7 @@ begin
end;
NewVal := Round6(StrToFloat(TEdit(Sender).Text));
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 }
TEdit(Sender).Text := Format('%.6g', [NewVal]);
if (OldVal <> NewVal) and Allow then
@ -4342,7 +4340,8 @@ begin
if (Sender = pnlWeight) then
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;
pEdit := @txtP;
end

View File

@ -5,6 +5,9 @@ interface
uses
XFormMan, BaseVariation;
const
MAX_WEIGHT = 1000.0;
type
TCPpoint = record
x, y, c: double;