Suppress translation if scale is zero (#82)
authorkingces95 <kingces95@users.noreply.github.com>
Wed, 13 Apr 2016 16:16:04 +0000 (09:16 -0700)
committerRui Marinho <me@ruimarinho.net>
Wed, 13 Apr 2016 16:16:04 +0000 (17:16 +0100)
Xamarin.Forms.Platform.WP8/VisualElementTracker.cs
Xamarin.Forms.Platform.WinRT/VisualElementTracker.cs

index 8211ec6..2163380 100644 (file)
@@ -324,8 +324,8 @@ namespace Xamarin.Forms.Platform.WinPhone
                        {
                                CenterOfRotationX = anchorX,
                                CenterOfRotationY = anchorY,
-                               GlobalOffsetX = translationX / scale,
-                               GlobalOffsetY = translationY / scale,
+                               GlobalOffsetX = scale == 0 ? 0 : translationX / scale,
+                               GlobalOffsetY = scale == 0 ? 0 : translationY / scale,
                                RotationX = -rotationX,
                                RotationY = -rotationY,
                                RotationZ = -rotation
index 0c3f759..760b9b3 100644 (file)
@@ -457,8 +457,8 @@ namespace Xamarin.Forms.Platform.WinRT
                                {
                                        CenterOfRotationX = anchorX,
                                        CenterOfRotationY = anchorY,
-                                       GlobalOffsetX = translationX / scale,
-                                       GlobalOffsetY = translationY / scale,
+                                       GlobalOffsetX = scale == 0 ? 0 : translationX / scale,
+                                       GlobalOffsetY = scale == 0 ? 0 : translationY / scale,
                                        RotationX = -rotationX,
                                        RotationY = -rotationY,
                                        RotationZ = -rotation