mirror of
https://github.com/ZuneDev/MicrosoftIris.git
synced 2026-07-27 13:13:29 -07:00
Make ItemAlignment encodable
This commit is contained in:
@@ -8,7 +8,7 @@ using Microsoft.Iris.Render;
|
||||
|
||||
namespace Microsoft.Iris.Layout
|
||||
{
|
||||
public struct ItemAlignment
|
||||
public struct ItemAlignment : IStringEncodable
|
||||
{
|
||||
private Alignment _horizontal;
|
||||
private Alignment _vertical;
|
||||
@@ -50,5 +50,13 @@ namespace Microsoft.Iris.Layout
|
||||
alignment.Vertical = fallback.Vertical;
|
||||
return alignment;
|
||||
}
|
||||
|
||||
public string EncodeString()
|
||||
{
|
||||
if (Vertical == Horizontal)
|
||||
return Vertical.ToString();
|
||||
else
|
||||
return $"{Horizontal}, {Vertical}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user