SynEdit: remove check for unnecessary calls to "DoOnResize". The check was wrong, e.g. if the Handle/Window was recreated, old/outdate values where used. Most likely the cause for issue #40241

This commit is contained in:
Martin 2024-04-15 15:42:05 +02:00
parent c971eaaa76
commit 3d50451e87

View File

@ -530,8 +530,6 @@ type
FStrings: TStrings; // External TStrings based interface to the Textbuffer FStrings: TStrings; // External TStrings based interface to the Textbuffer
fMaxLeftChar: Integer; // 1024 fMaxLeftChar: Integer; // 1024
FOldWidth, FOldHeight: Integer;
FPaintLock: Integer; FPaintLock: Integer;
FPaintLockOwnerCnt: Integer; FPaintLockOwnerCnt: Integer;
FUndoBlockAtPaintLock: Integer; FUndoBlockAtPaintLock: Integer;
@ -2268,8 +2266,6 @@ begin
FCaret.Lines := FTheLinesView; FCaret.Lines := FTheLinesView;
FInternalCaret.Lines := FTheLinesView; FInternalCaret.Lines := FTheLinesView;
FFontDummy := TFont.Create; FFontDummy := TFont.Create;
FOldWidth := -1;
FOldHeight := -1;
with FTheLinesView do begin with FTheLinesView do begin
AddChangeHandler(senrLineCount, @LineCountChanged); AddChangeHandler(senrLineCount, @LineCountChanged);
@ -5358,9 +5354,8 @@ end;
procedure TCustomSynEdit.DoOnResize; procedure TCustomSynEdit.DoOnResize;
begin begin
inherited; inherited;
if (not HandleAllocated) or ((ClientWidth = FOldWidth) and (ClientHeight = FOldHeight)) then exit; if (not HandleAllocated) then
FOldWidth := ClientWidth; exit;
FOldHeight := ClientHeight;
inc(FScrollBarUpdateLock); inc(FScrollBarUpdateLock);
FScreenCaret.Lock; FScreenCaret.Lock;
try try