From 53c64ef83ef3baa65c60995e9f3d82c17752d6fe Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Thu, 20 Mar 2025 09:00:56 +0100 Subject: [PATCH] =?UTF-8?q?feat(Annotation):=20Erstellt,=20um=20Gr=C3=B6?= =?UTF-8?q?=C3=9Fe=20und=20Layout=20der=20Anmerkungen=20von=20Umschl=C3=A4?= =?UTF-8?q?gen=20zu=20handhaben?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EnvelopeGenerator.Web/Models/Annotation.cs | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 EnvelopeGenerator.Web/Models/Annotation.cs diff --git a/EnvelopeGenerator.Web/Models/Annotation.cs b/EnvelopeGenerator.Web/Models/Annotation.cs new file mode 100644 index 00000000..85bd0ef0 --- /dev/null +++ b/EnvelopeGenerator.Web/Models/Annotation.cs @@ -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 +}; \ No newline at end of file