In Delphi 11, using the FMX framework, I am trying to achieve a smooth resize of a TForm, but each time I change the Left and Width of a TForm simultaneously, the form appears to jitter. As if first the Left position is changed, the form updated, then the Width. Same problem when using SetBounds.
In the VCL framework, there is the option to use DoubleBuffered, but this is absent in FMX.
I have tried several possible solutions, like nesting the code inside a BeginUpdate/EndUpdate, to no avail.
The shortest piece of code to more or less illustrate this is:
unit JitteryResizeTestUnit;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Controls.Presentation, FMX.StdCtrls;
type
TForm1 = class(TForm)
tmr1: TTimer;
procedure tmr1Timer(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.fmx}
procedure TForm1.tmr1Timer(Sender: TObject);
begin
if Left < 50 then tmr1.Enabled := False;
Left := Left - 10;
Width := Width + 10
end;
end.
With, for instance, a timer Interval of 50.