From c83ed43a5c86f541e7781066d51ddf754cab5f8a Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 31 Jul 2012 10:27:58 +0100 Subject: progressbar: text percentage is now only calculated when really needed. --- src/gui/fpg_progressbar.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/fpg_progressbar.pas') 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); -- cgit v1.2.3-70-g09d2