Skip to content

Commit

Permalink
Fixed typos in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmarder committed Mar 31, 2021
1 parent 702cffd commit 3c226c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Source/VirtualTrees.WorkerThread.pas
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class procedure TWorkerThread.Dispose(CanBlock: Boolean);
WorkerThread.Terminate();
SetEvent(WorkerThread.FWorkEvent);
LRef := WorkerThread;
WorkerThread := nil; //Will be freed usinf TThreaf.FreeOnTerminate
WorkerThread := nil; //Will be freed usinf TThread.FreeOnTerminate
if CanBlock then
LRef.Free;
end;
Expand Down
7 changes: 4 additions & 3 deletions Source/VirtualTrees.pas
Original file line number Diff line number Diff line change
Expand Up @@ -9654,19 +9654,20 @@ procedure TVTHeader.AutoScale();
begin
if toAutoChangeScale in Treeview.TreeOptions.AutoOptions then
begin
// Find the largest Columns[].Spacing
// Ensure a minimum header size based on the font, so that all text is visible.
// First find the largest Columns[].Spacing
lMaxHeight := 0;
for I := 0 to Self.Columns.Count - 1 do
lMaxHeight := Max(lMaxHeight, Columns[I].Spacing);
// Calculate the required size based on the font, this is important as the use migth just vave increased the size of the icon font
// Calculate the required height based on the font, this is important as the user might just have increased the size of the system icon font.
with TBitmap.Create do
try
Canvas.Font.Assign(FFont);
lMaxHeight := lMaxHeight {top spacing} + (lMaxHeight div 2) {minimum bottom spacing} + Canvas.TextHeight('Q');
finally
Free;
end;
// Get the maximum of the scaled original value an
// Get the maximum of the scaled original value and the minimum needed header height.
lMaxHeight := Max(lMaxHeight, FHeight);
// Set the calculated size
Self.SetHeight(lMaxHeight);
Expand Down

0 comments on commit 3c226c1

Please sign in to comment.