Alcinoe icon indicating copy to clipboard operation
Alcinoe copied to clipboard

Delphi 12 Replacement for TALVertScrollBox.AniCalculations.BoundsAnimation

Open Elinulok32 opened this issue 1 year ago • 5 comments

Hello, how do I prevent the edges of the Alcinoe scrollboxes from springing back in delphi 12, like we used to do in Alexendria 11.3 with AniCalculations.BoundsAnimation. I tried TALVertScrollBox.ScrollEngine.MinEdgeSpringbackEnabled := False; and TALVertScrollBox.ScrollEngine.MaxEdgeSpringbackEnabled := False; but it did not work. Please your help is urgently needed.

Elinulok32 avatar Jun 09 '24 16:06 Elinulok32

hi normaly MinEdgeSpringbackEnabled and MaxEdgeSpringbackEnabled must do the job, can you send me a demo project just i can see what wrong ?

Zeus64 avatar Jun 09 '24 17:06 Zeus64

hi normaly MinEdgeSpringbackEnabled and MaxEdgeSpringbackEnabled must do the job, can you send me a demo project just i can see what wrong ?

Hello @Zeus64, please I've sent you the demo you requested for and it's been 3 days now. I know you're very busy but kindly check it up and revert soon. Thanks

Elinulok32 avatar Jun 12 '24 23:06 Elinulok32

hello, MinEdgeSpringbackEnabled and MaxEdgeSpringbackEnabled work only for the animation (not when your finger is actually touching the screen). to achieve what you want you have 2 options :

1/ uses ALVertScrollBox1.ScrollEngine.DragResistanceFactor := 0; but for this to work you must include the modification commited here : https://github.com/MagicFoundation/Alcinoe/commit/852075bde5f38d0c3e55e05c93f9737b6f97826a

2/ handle manually the ViewportPositionChange

procedure TForm1.ALVertScrollBox1ViewportPositionChange(Sender: TObject;
  const OldViewportPosition, NewViewportPosition: TPointF);
begin
  if NewViewportPosition.Y < 0 then
    ALVertScrollBox1.ScrollEngine.ViewportPosition := TAlPointD.create(NewViewportPosition.X, 0)
  else if NewViewportPosition.Y > ALVertScrollBox1.ScrollEngine.MaxScrollLimit.y then
    ALVertScrollBox1.ScrollEngine.ViewportPosition := TAlPointD.create(NewViewportPosition.X, ALVertScrollBox1.ScrollEngine.MaxScrollLimit.y);
end;

Zeus64 avatar Jun 13 '24 13:06 Zeus64

Hello, thanks for getting back soon. The second option worked fine for me. I'm very grateful.

Elinulok32 avatar Jun 13 '24 23:06 Elinulok32