From 8121918b552c50230826aa7aa91c8da2ab1e2360 Mon Sep 17 00:00:00 2001 From: zueuk Date: Sat, 9 Dec 2006 14:42:02 +0000 Subject: [PATCH] added new constant MAX_WEIGHT --- 2.10/Source/Editor.dfm | 4 ++-- 2.10/Source/Editor.pas | 9 ++++----- 2.10/Source/XForm.pas | 3 +++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/2.10/Source/Editor.dfm b/2.10/Source/Editor.dfm index 9a134b7..1f9926b 100644 --- a/2.10/Source/Editor.dfm +++ b/2.10/Source/Editor.dfm @@ -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 diff --git a/2.10/Source/Editor.pas b/2.10/Source/Editor.pas index 870bc7c..1ad6ab7 100644 --- a/2.10/Source/Editor.pas +++ b/2.10/Source/Editor.pas @@ -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 diff --git a/2.10/Source/XForm.pas b/2.10/Source/XForm.pas index 6587d1a..db0e019 100644 --- a/2.10/Source/XForm.pas +++ b/2.10/Source/XForm.pas @@ -5,6 +5,9 @@ interface uses XFormMan, BaseVariation; +const + MAX_WEIGHT = 1000.0; + type TCPpoint = record x, y, c: double;