Skip to content

Commit

Permalink
Issue #1198: e) Do not link scaling to toAutoChangeScale
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmarder committed Aug 1, 2023
1 parent 57182fc commit 061beff
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions Source/VirtualTrees.BaseTree.pas
Original file line number Diff line number Diff line change
Expand Up @@ -8977,31 +8977,28 @@ procedure TBaseVirtualTree.Change(Node: PVirtualNode);

procedure TBaseVirtualTree.ChangeScale(M, D: Integer{$if CompilerVersion >= 31}; isDpiChange: Boolean{$ifend});
begin
if (toAutoChangeScale in FOptions.AutoOptions) then
if (M <> D) then
begin
if (M <> D) then
begin
BeginUpdate();
try
TVTHeaderCracker(FHeader).ChangeScale(M, D);
SetDefaultNodeHeight(MulDiv(FDefaultNodeHeight, M, D));
Indent := MulDiv(Indent, M, D);
FTextMargin := MulDiv(FTextMargin, M, D);
FMargin := MulDiv(FMargin, M, D);
FImagesMargin := MulDiv(FImagesMargin, M, D);
// Scale utility images, #796
if FCheckImageKind = ckSystemDefault then begin
FreeAndNil(FCheckImages);
if HandleAllocated then
FCheckImages := CreateSystemImageSet(Self);
end;
UpdateHeaderRect();
ScaleNodeHeights(M, D);
finally
EndUpdate();
end;//try..finally
end;// if M<>D
end;//if toAutoChangeScale
BeginUpdate();
try
TVTHeaderCracker(FHeader).ChangeScale(M, D);
SetDefaultNodeHeight(MulDiv(FDefaultNodeHeight, M, D));
Indent := MulDiv(Indent, M, D);
FTextMargin := MulDiv(FTextMargin, M, D);
FMargin := MulDiv(FMargin, M, D);
FImagesMargin := MulDiv(FImagesMargin, M, D);
// Scale utility images, #796
if FCheckImageKind = ckSystemDefault then begin
FreeAndNil(FCheckImages);
if HandleAllocated then
FCheckImages := CreateSystemImageSet(Self);
end;
UpdateHeaderRect();
ScaleNodeHeights(M, D);
finally
EndUpdate();
end;//try..finally
end;// if M<>D
inherited ChangeScale(M, D{$if CompilerVersion >= 31}, isDpiChange{$ifend});
if (M <> D) then
PrepareBitmaps(True, False) // See issue #991
Expand Down

0 comments on commit 061beff

Please sign in to comment.