Skip to content

Commit fbb28a7

Browse files
committed
Fixed issue #1289: AV on middle button click
1 parent 9252d32 commit fbb28a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/VirtualTrees.BaseTree.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14834,11 +14834,11 @@ procedure TBaseVirtualTree.StartWheelPanning(Position: TPoint);
1483414834
try
1483514835
PanningImage.Handle := LoadImage(0, MAKEINTRESOURCE(ImageName), IMAGE_CURSOR, Form.Width, Form.Height, LR_DEFAULTCOLOR or LR_LOADTRANSPARENT);
1483614836
Image.Picture.Assign(PanningImage);
14837+
Form.Left := Pos.X - (PanningImage.Width div 2);
14838+
Form.Top := Pos.Y - (PanningImage.Height div 2);
1483714839
finally
1483814840
PanningImage.Free;
1483914841
end;
14840-
Form.Left := Pos.X - (PanningImage.Width div 2);
14841-
Form.Top := Pos.Y - (PanningImage.Height div 2);
1484214842
Form.Position := poDesigned;
1484314843
// This prevents a focus chnage compare to using TForm.Show()
1484414844
ShowWindow(Form.Handle, SW_SHOWNOACTIVATE);

0 commit comments

Comments
 (0)