Closed ChristopherStephan closed 3 years ago
Can you make a PR?
Probably not. I tried to debug on commit 0811327837b259d2c1c3ec50a9925263e9213775 why Scale is not working but I guess the bug was introduced by a major refactoring, that I do not completely understand.
I guess that this is the root of the problem: Inside the OnElementPropertyChanged of Lottie.Forms.Platforms.Ios.AnimationViewRenderer reacting to Scale changes is commented out:
//if (e.PropertyName == AnimationView.ScaleProperty.PropertyName)
// _animationView.Scale = Element.Scale;
LOTAnimationView does not contain a definition for it, so it cannot simply be commented in again:
'LOTAnimationView' does not contain a definition for 'Scale' and no accessible extension method 'Scale' accepting a first argument of type 'LOTAnimationView' could be found (are you missing a using directive or an assembly reference?)
I get many of these kind of errors, but still the solution compiles:
https://github.com/Baseflow/LottieXamarin/blob/develop/Lottie.Forms/AnimationView.cs#L56 Scale is overwritten with the new keyword here. Maybe that was used in the past?
I use ScaleX and ScaleY as a workaround. Works perfectly.
🐛 Bug Report
With version 4.0.0 the property "Scale" seems to be broken: the animation is not scaled when changing the property's value. With version 3.1.3 the scaling was working. This bug affects Android and iOS.
A git bisect on branch develop identified several possible first broken commits, from which only 297982db1965dc27904da6d5a40ed3efd22bec5e proved that Scale is not working (other commits listed did not show the Lottie animation):
Expected behavior
Scale should take effect on the animation view.
Reproduction steps
Configuration
Version: 4.0.6 (version 4.0.0 introduced the bug)
Platform: