-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ebaec02
commit ff6203e
Showing
18 changed files
with
827 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
namespace Microsoft.Maui | ||
{ | ||
/// <summary> | ||
/// Provides functionality to be able to apply transformations to a View. | ||
/// </summary> | ||
public interface ITransform | ||
{ | ||
/// <summary> | ||
/// Gets the X translation delta of the element. | ||
/// </summary> | ||
double TranslationX { get; } | ||
|
||
/// <summary> | ||
/// Gets the Y translation delta of the element. | ||
/// </summary> | ||
double TranslationY { get; } | ||
|
||
/// <summary> | ||
/// Gets the scale factor applied to the element. | ||
/// </summary> | ||
double Scale { get; } | ||
|
||
/// <summary> | ||
/// Gets the scale about the X-axis factor applied to the element. | ||
/// </summary> | ||
double ScaleX { get; } | ||
|
||
/// <summary> | ||
/// Gets the scale about the Y-axis factor applied to the element. | ||
/// </summary> | ||
double ScaleY { get; } | ||
|
||
/// <summary> | ||
/// Gets the rotation (in degrees) about the Z-axis (affine rotation) | ||
/// when the element is rendered. | ||
/// </summary> | ||
double Rotation { get; } | ||
|
||
/// <summary> | ||
/// Gets the rotation (in degrees) about the X-axis (perspective rotation) | ||
/// when the element is rendered. | ||
/// </summary> | ||
double RotationX { get; } | ||
|
||
/// <summary> | ||
/// Gets the rotation (in degrees) about the Y-axis (perspective rotation) | ||
/// when the element is rendered. | ||
/// </summary> | ||
double RotationY { get; } | ||
|
||
/// <summary> | ||
/// Gets the X component of the center point for any transform, relative | ||
/// to the bounds of the element. | ||
/// </summary> | ||
double AnchorX { get; } | ||
|
||
/// <summary> | ||
/// Gets the Y component of the center point for any transform, relative | ||
/// to the bounds of the element. | ||
/// </summary> | ||
double AnchorY { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
namespace Microsoft.Maui.Handlers | ||
{ | ||
public partial class ViewHandler | ||
{ | ||
public static void MapTranslationX(IViewHandler handler, IView view) { } | ||
|
||
public static void MapTranslationY(IViewHandler handler, IView view) { } | ||
|
||
public static void MapScale(IViewHandler handler, IView view) { } | ||
|
||
public static void MapScaleX(IViewHandler handler, IView view) { } | ||
|
||
public static void MapScaleY(IViewHandler handler, IView view) { } | ||
|
||
public static void MapRotation(IViewHandler handler, IView view) { } | ||
|
||
public static void MapRotationX(IViewHandler handler, IView view) { } | ||
|
||
public static void MapRotationY(IViewHandler handler, IView view) { } | ||
|
||
public static void MapAnchorX(IViewHandler handler, IView view) { } | ||
|
||
public static void MapAnchorY(IViewHandler handler, IView view) { } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#nullable enable | ||
using NativeView = Microsoft.UI.Xaml.FrameworkElement; | ||
|
||
namespace Microsoft.Maui.Handlers | ||
{ | ||
public partial class ViewHandler | ||
{ | ||
public static void MapTranslationX(IViewHandler handler, IView view) | ||
{ | ||
((NativeView?)handler.NativeView)?.UpdateTransformation(view); | ||
} | ||
|
||
public static void MapTranslationY(IViewHandler handler, IView view) | ||
{ | ||
((NativeView?)handler.NativeView)?.UpdateTransformation(view); | ||
} | ||
|
||
public static void MapScale(IViewHandler handler, IView view) | ||
{ | ||
((NativeView?)handler.NativeView)?.UpdateTransformation(view); | ||
} | ||
|
||
public static void MapScaleX(IViewHandler handler, IView view) | ||
{ | ||
((NativeView?)handler.NativeView)?.UpdateTransformation(view); | ||
} | ||
|
||
public static void MapScaleY(IViewHandler handler, IView view) | ||
{ | ||
((NativeView?)handler.NativeView)?.UpdateTransformation(view); | ||
} | ||
|
||
public static void MapRotation(IViewHandler handler, IView view) | ||
{ | ||
((NativeView?)handler.NativeView)?.UpdateTransformation(view); | ||
} | ||
|
||
public static void MapRotationX(IViewHandler handler, IView view) | ||
{ | ||
((NativeView?)handler.NativeView)?.UpdateTransformation(view); | ||
} | ||
|
||
public static void MapRotationY(IViewHandler handler, IView view) | ||
{ | ||
((NativeView?)handler.NativeView)?.UpdateTransformation(view); | ||
} | ||
|
||
public static void MapAnchorX(IViewHandler handler, IView view) | ||
{ | ||
((NativeView?)handler.NativeView)?.UpdateTransformation(view); | ||
} | ||
|
||
public static void MapAnchorY(IViewHandler handler, IView view) | ||
{ | ||
((NativeView?)handler.NativeView)?.UpdateTransformation(view); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.