Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 1ba852e

Browse files
kingces95rmarinho
authored andcommitted
Suppress translation if scale is zero (#82)
1 parent fa2fcd4 commit 1ba852e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Xamarin.Forms.Platform.WP8/VisualElementTracker.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,8 @@ static void UpdateRotation(VisualElement view, FrameworkElement frameworkElement
324324
{
325325
CenterOfRotationX = anchorX,
326326
CenterOfRotationY = anchorY,
327-
GlobalOffsetX = translationX / scale,
328-
GlobalOffsetY = translationY / scale,
327+
GlobalOffsetX = scale == 0 ? 0 : translationX / scale,
328+
GlobalOffsetY = scale == 0 ? 0 : translationY / scale,
329329
RotationX = -rotationX,
330330
RotationY = -rotationY,
331331
RotationZ = -rotation

Xamarin.Forms.Platform.WinRT/VisualElementTracker.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,8 @@ static void UpdateRotation(VisualElement view, FrameworkElement frameworkElement
457457
{
458458
CenterOfRotationX = anchorX,
459459
CenterOfRotationY = anchorY,
460-
GlobalOffsetX = translationX / scale,
461-
GlobalOffsetY = translationY / scale,
460+
GlobalOffsetX = scale == 0 ? 0 : translationX / scale,
461+
GlobalOffsetY = scale == 0 ? 0 : translationY / scale,
462462
RotationX = -rotationX,
463463
RotationY = -rotationY,
464464
RotationZ = -rotation

0 commit comments

Comments
 (0)