feat(Annotation): Erstellt, um Größe und Layout der Anmerkungen von Umschlägen zu handhaben
This commit is contained in:
parent
3ac0cbeaae
commit
53c64ef83e
58
EnvelopeGenerator.Web/Models/Annotation.cs
Normal file
58
EnvelopeGenerator.Web/Models/Annotation.cs
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
namespace EnvelopeGenerator.Web.Models;
|
||||||
|
|
||||||
|
public record Annotation(
|
||||||
|
string Id,
|
||||||
|
string? HorBoundAnnotId = null, string? VerBoundAnnotId = null)
|
||||||
|
{
|
||||||
|
#region Layout
|
||||||
|
internal double _marginX = default;
|
||||||
|
|
||||||
|
internal double _marginY = default;
|
||||||
|
|
||||||
|
internal double _width = default;
|
||||||
|
|
||||||
|
internal double _height = default;
|
||||||
|
|
||||||
|
public double MarginX
|
||||||
|
{
|
||||||
|
get => _marginX;
|
||||||
|
init => _marginX = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double MarginY
|
||||||
|
{
|
||||||
|
get => _marginY;
|
||||||
|
init => _marginY = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double Width
|
||||||
|
{
|
||||||
|
get => _width;
|
||||||
|
init => _width = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double Height
|
||||||
|
{
|
||||||
|
get => _height;
|
||||||
|
init => _height = value;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Pos
|
||||||
|
public double PosX => MarginX + (HorBoundAnnot?.HorBoundary ?? 0);
|
||||||
|
|
||||||
|
public double PosY => MarginY + (VerBoundAnnot?.VerBoundary ?? 0);
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Boundary
|
||||||
|
public double HorBoundary => MarginX + Width;
|
||||||
|
|
||||||
|
public double VerBoundary => MarginY + Height;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region BoundAnnot
|
||||||
|
public Annot? HorBoundAnnot { get; set; }
|
||||||
|
|
||||||
|
public Annot? VerBoundAnnot { get; set; }
|
||||||
|
#endregion
|
||||||
|
};
|
||||||
Loading…
x
Reference in New Issue
Block a user