diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2014-10-15 13:41:08 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2014-10-15 13:41:08 +0100 |
commit | 45de93127fdb82ea5345b1b0d173f33359e9a62d (patch) | |
tree | 1663be6de32baa6b378b93448541846a5282c928 /src/gui | |
parent | ae49a6e611fc8d0a6e2d38b6e51a224cbbb807ba (diff) | |
download | fpGUI-45de93127fdb82ea5345b1b0d173f33359e9a62d.tar.xz |
memo: added extra sanity check for EndUpdate method.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/fpg_memo.pas | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/fpg_memo.pas b/src/gui/fpg_memo.pas index 374c8d47..672e7126 100644 --- a/src/gui/fpg_memo.pas +++ b/src/gui/fpg_memo.pas @@ -308,12 +308,12 @@ var begin VHeight := Height - 4; HWidth := Width - 4; - + if FVScrollBar.Visible then Dec(HWidth, FVScrollBar.Width); if FHScrollBar.Visible then Dec(VHeight, FHScrollBar.Height); - + FHScrollBar.Top := Height -FHScrollBar.Height - 2; FHScrollBar.Left := 2; FHScrollBar.Width := HWidth; @@ -1048,7 +1048,7 @@ begin if not Focused then fpgCaret.UnSetCaret(Canvas); - + // The little square in the bottom right corner if FHScrollBar.Visible and FVScrollBar.Visible then begin @@ -1348,7 +1348,7 @@ begin RePaint else inherited; - + if hasChanged then if Assigned(FOnChange) then FOnChange(self); @@ -1675,7 +1675,8 @@ end; procedure TfpgMemo.EndUpdate; begin - Dec(FUpdateCount); + if FUpdateCount > 0 then + Dec(FUpdateCount); if FUpdateCount <= 0 then begin Invalidate; |