diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-06-01 10:16:20 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-06-01 10:16:20 +0200 |
commit | c94aa6aa8f0e6fc318226c15f1c0f6e139ad37ff (patch) | |
tree | 81f3e0b9193fe4f325cfbadff569fc570bcf5323 | |
parent | 27606b67fc8a6eb8b101afe5ee5db4ad2bbcf98f (diff) | |
download | fpGUI-c94aa6aa8f0e6fc318226c15f1c0f6e139ad37ff.tar.xz |
Fixed potential division by zero bug.
This can occur when component is displayed with no text. :-/
-rw-r--r-- | prototypes/textedit/fpg_textedit.pas | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/prototypes/textedit/fpg_textedit.pas b/prototypes/textedit/fpg_textedit.pas index ebe66222..bb313717 100644 --- a/prototypes/textedit/fpg_textedit.pas +++ b/prototypes/textedit/fpg_textedit.pas @@ -457,7 +457,8 @@ begin FVScrollBar.PageSize := FVisLines - 4; FVScrollBar.Max := FLines.Count - FVisLines + 1; // +1 is so the last line is completely visible FVScrollBar.Position := VPos; - FVScrollBar.SliderSize := FVisLines / FLines.Count; + if FLines.Count > 0 then + FVScrollBar.SliderSize := FVisLines / FLines.Count; FVScrollBar.Visible := FLines.Count > FVisLines; FHScrollBar.Min := 0; |