-
Notifications
You must be signed in to change notification settings - Fork 27
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
Showing
4 changed files
with
85 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Numerics; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Windows.Foundation; | ||
using Windows.UI.WebUI; | ||
|
||
namespace Uno.Toolkit.UI; | ||
|
||
internal static partial class TwoDExtensions // Point Mathematics | ||
{ | ||
public static Point ToPoint(this Size x) => new Point(x.Width, x.Height); | ||
public static Point ToPoint(this Vector2 x) => new Point(x.X, x.Y); | ||
|
||
public static Point MultiplyBy(this Point x, double scale) => new Point(x.X * scale, x.Y * scale); | ||
public static Point MultiplyBy(this Point x, double scaleX, double scaleY) => new Point(x.X * scaleX, x.Y * scaleY); | ||
public static Point DivideBy(this Point x, double scale) => new Point(x.X / scale, x.Y / scale); | ||
} | ||
|
||
internal static partial class TwoDExtensions // Size Mathematics | ||
{ | ||
public static Size ToSize(this Point x) => new Size(x.X, x.Y); | ||
public static Size ToSize(this Vector2 x) => new Size(x.X, x.Y); | ||
|
||
public static Size MultiplyBy(this Size x, double scale) => new Size(x.Width * scale, x.Height * scale); | ||
public static Size DivideBy(this Size x, double scale) => new Size(x.Width / scale, x.Height / scale); | ||
} |