summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkingces95 <kingces95@users.noreply.github.com>2016-04-13 09:16:04 -0700
committerRui Marinho <me@ruimarinho.net>2016-04-13 17:16:04 +0100
commita67a1daad040f67edbad37adb22188fbdc5da195 (patch)
treecf2745657d27254093376c1eb2831044f93294d6
parent5809eb5d4e7cd5f596ed7ad0c0265605b9c9600e (diff)
downloadxamarin-forms-a67a1daad040f67edbad37adb22188fbdc5da195.tar.gz
xamarin-forms-a67a1daad040f67edbad37adb22188fbdc5da195.tar.bz2
xamarin-forms-a67a1daad040f67edbad37adb22188fbdc5da195.zip
Suppress translation if scale is zero (#82)
-rw-r--r--Xamarin.Forms.Platform.WP8/VisualElementTracker.cs4
-rw-r--r--Xamarin.Forms.Platform.WinRT/VisualElementTracker.cs4
2 files changed, 4 insertions, 4 deletions
diff --git a/Xamarin.Forms.Platform.WP8/VisualElementTracker.cs b/Xamarin.Forms.Platform.WP8/VisualElementTracker.cs
index 8211ec63..21633806 100644
--- a/Xamarin.Forms.Platform.WP8/VisualElementTracker.cs
+++ b/Xamarin.Forms.Platform.WP8/VisualElementTracker.cs
@@ -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
diff --git a/Xamarin.Forms.Platform.WinRT/VisualElementTracker.cs b/Xamarin.Forms.Platform.WinRT/VisualElementTracker.cs
index 0c3f7595..760b9b30 100644
--- a/Xamarin.Forms.Platform.WinRT/VisualElementTracker.cs
+++ b/Xamarin.Forms.Platform.WinRT/VisualElementTracker.cs
@@ -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