From faa6eae8e72d810c8d16dd92e02b305dbf35548c Mon Sep 17 00:00:00 2001 From: Stephane Delcroix Date: Mon, 6 Feb 2017 15:18:16 +0100 Subject: Revert "[*] ScaleX and ScaleY" This reverts commit fc7d556848e731902d096953c9b4fb28a2466e6b. --- .../VisualElementTracker.cs | 25 +++++++--------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'Xamarin.Forms.Platform.Android/VisualElementTracker.cs') diff --git a/Xamarin.Forms.Platform.Android/VisualElementTracker.cs b/Xamarin.Forms.Platform.Android/VisualElementTracker.cs index b2e9fe47..7ade4596 100644 --- a/Xamarin.Forms.Platform.Android/VisualElementTracker.cs +++ b/Xamarin.Forms.Platform.Android/VisualElementTracker.cs @@ -120,7 +120,7 @@ namespace Xamarin.Forms.Platform.Android if (e.PropertyName == VisualElement.XProperty.PropertyName || e.PropertyName == VisualElement.YProperty.PropertyName || e.PropertyName == VisualElement.WidthProperty.PropertyName || e.PropertyName == VisualElement.HeightProperty.PropertyName) _layoutNeeded = true; - else if (e.PropertyName == VisualElement.AnchorXProperty.PropertyName || e.PropertyName == VisualElement.AnchorYProperty.PropertyName || e.PropertyName == VisualElement.ScaleProperty.PropertyName || e.PropertyName == VisualElement.ScaleXProperty.PropertyName || e.PropertyName == VisualElement.ScaleYProperty.PropertyName || + else if (e.PropertyName == VisualElement.AnchorXProperty.PropertyName || e.PropertyName == VisualElement.AnchorYProperty.PropertyName || e.PropertyName == VisualElement.ScaleProperty.PropertyName || e.PropertyName == VisualElement.RotationProperty.PropertyName || e.PropertyName == VisualElement.RotationXProperty.PropertyName || e.PropertyName == VisualElement.RotationYProperty.PropertyName || e.PropertyName == VisualElement.IsVisibleProperty.PropertyName || e.PropertyName == VisualElement.OpacityProperty.PropertyName || e.PropertyName == VisualElement.TranslationXProperty.PropertyName || e.PropertyName == VisualElement.TranslationYProperty.PropertyName) @@ -138,7 +138,7 @@ namespace Xamarin.Forms.Platform.Android UpdateAnchorX(); else if (e.PropertyName == VisualElement.AnchorYProperty.PropertyName) UpdateAnchorY(); - else if (e.PropertyName == VisualElement.ScaleProperty.PropertyName || e.PropertyName == VisualElement.ScaleXProperty.PropertyName || e.PropertyName == VisualElement.ScaleYProperty.PropertyName) + else if (e.PropertyName == VisualElement.ScaleProperty.PropertyName) UpdateScale(); else if (e.PropertyName == VisualElement.RotationProperty.PropertyName) UpdateRotation(); @@ -230,7 +230,7 @@ namespace Xamarin.Forms.Platform.Android UpdateRotationX(); if (oldElement.RotationY != newElement.RotationY) UpdateRotationY(); - if (oldElement.Scale != newElement.Scale || oldElement.ScaleX != newElement.ScaleY || oldElement.ScaleY != newElement.ScaleY) + if (oldElement.Scale != newElement.Scale) UpdateScale(); // ReSharper restore CompareOfFloatsByEqualityOperator @@ -299,18 +299,9 @@ namespace Xamarin.Forms.Platform.Android if (aview is FormsViewGroup) { var formsViewGroup = (FormsViewGroup)aview; - formsViewGroup.SendBatchUpdate((float)(view.AnchorX * _context.ToPixels(view.Width)), - (float)(view.AnchorY * _context.ToPixels(view.Height)), - (int)(view.IsVisible ? ViewStates.Visible : ViewStates.Invisible), - view.IsEnabled, - (float)view.Opacity, - (float)view.Rotation, - (float)view.RotationX, - (float)view.RotationY, - (float)view.ScaleX, - (float)view.ScaleY, - _context.ToPixels(view.TranslationX), - _context.ToPixels(view.TranslationY)); + formsViewGroup.SendBatchUpdate((float)(view.AnchorX * _context.ToPixels(view.Width)), (float)(view.AnchorY * _context.ToPixels(view.Height)), + (int)(view.IsVisible ? ViewStates.Visible : ViewStates.Invisible), view.IsEnabled, (float)view.Opacity, (float)view.Rotation, (float)view.RotationX, (float)view.RotationY, (float)view.Scale, + _context.ToPixels(view.TranslationX), _context.ToPixels(view.TranslationY)); } else { @@ -374,8 +365,8 @@ namespace Xamarin.Forms.Platform.Android VisualElement view = _renderer.Element; AView aview = _renderer.ViewGroup; - aview.ScaleX = (float)view.Scale * (float)view.ScaleX; - aview.ScaleY = (float)view.Scale * (float)view.ScaleY; + aview.ScaleX = (float)view.Scale; + aview.ScaleY = (float)view.Scale; } void UpdateTranslationX() -- cgit v1.2.3