diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-07-31 10:27:58 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-07-31 10:27:58 +0100 |
commit | c83ed43a5c86f541e7781066d51ddf754cab5f8a (patch) | |
tree | 7a64dbcfc0b820007da44f5e4d3f99bf31ec22f6 /src/gui | |
parent | 9ad66f025cc15a7a47b0fc0055293dde35b1400c (diff) | |
download | fpGUI-c83ed43a5c86f541e7781066d51ddf754cab5f8a.tar.xz |
progressbar: text percentage is now only calculated when really needed.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/fpg_progressbar.pas | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/fpg_progressbar.pas b/src/gui/fpg_progressbar.pas index 7ec45cc0..c9c3861e 100644 --- a/src/gui/fpg_progressbar.pas +++ b/src/gui/fpg_progressbar.pas @@ -166,7 +166,6 @@ begin diff := Max - Min; // diff.. aPos := Position - Min; // absolute position percent := round(((100 / diff) * aPos)); - txt := IntToStr(percent) + '%'; pos := round(percent * (Width-2) / 100); // Bluecurve theme :) @@ -193,6 +192,7 @@ begin // paint percentage if required if FShowCaption then begin + txt := IntToStr(percent) + '%'; x := (Width - FFont.TextWidth(txt)) div 2; y := (Height - FFont.Height) div 2; Canvas.SetTextColor(TextColor); |