I am having issues with the following code:
procedure TForm1.Button1Click(Sender: TObject);
var Rectangle:TRectangle;
Animation: TFloatAnimation;
begin
Rectangle := TRectangle.Create(Self);
With Rectangle do
begin
Parent := Form1;
Height := 65;
Width := 65;
end;
Animation := TFloatAnimation.Create(Rectangle);
with Animation do
begin
Parent := Rectangle;
PropertyName := 'Size.Width';
StartValue := 65;
StopValue := 120;
Trigger := 'IsMouseOver=true';
TriggerInverse := 'IsMouseOver=false';
Interpolation := TInterpolationType.Cubic;
end;
end;
Whenever my mouse cursor leaves the created rectangle, it leaves an "afterimage" as shown below:
How can I fix this?
Whenever I tried increasing the duration of the Float Animation, it did not leave the afterimage. However, I am required to have a faster animation without the slow-down of having a long animation.
PropertyName := 'Size.Width';
removeSize
. Iow, use:PropertyName := 'Width';
Size.Width
does not notify parent component/control that it needs updating. I'm not sure whether this is by design or a bug.