From 14be46d3d685dbd3958a8fe64d1535bed29088d8 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Thu, 20 Mar 2025 14:56:36 +0100 Subject: [PATCH] =?UTF-8?q?refactor(Annotation):=20Umbenennen=20von=20left?= =?UTF-8?q?=20in=20marginLeft,=20top=20in=20marginTop,=20posX=20in=20Left?= =?UTF-8?q?=20und=20posY=20in=20top=20f=C3=BCr=20eine=20CSS-=C3=A4hnlicher?= =?UTF-8?q?e=20Benennung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EnvelopeGenerator.Web/Models/Annotation.cs | 28 +++++++++---------- .../Models/AnnotationParams.cs | 8 +++--- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/EnvelopeGenerator.Web/Models/Annotation.cs b/EnvelopeGenerator.Web/Models/Annotation.cs index cb08d806..e909eddf 100644 --- a/EnvelopeGenerator.Web/Models/Annotation.cs +++ b/EnvelopeGenerator.Web/Models/Annotation.cs @@ -13,24 +13,24 @@ public record Annotation #endregion #region Layout - internal double _left = default; + internal double _marginLeft = default; - internal double _top = default; + internal double _marginTop = default; internal double _width = default; internal double _height = default; - - public double Left + + public double MarginLeft { - get => _left; - init => _left = value; + get => _marginLeft; + init => _marginLeft = value; } - public double Top + public double MarginTop { - get => _top; - init => _top = value; + get => _marginTop; + init => _marginTop = value; } public double Width @@ -46,16 +46,16 @@ public record Annotation } #endregion - #region Pos - public double PosX => Left + (HorBoundAnnot?.HorBoundary ?? 0); + #region Position + public double Left => MarginLeft + (HorBoundAnnot?.HorBoundary ?? 0); - public double PosY => Top + (VerBoundAnnot?.VerBoundary ?? 0); + public double Top => MarginTop + (VerBoundAnnot?.VerBoundary ?? 0); #endregion #region Boundary - public double HorBoundary => Left + Width; + public double HorBoundary => MarginLeft + Width; - public double VerBoundary => Top + Height; + public double VerBoundary => MarginTop + Height; #endregion #region BoundAnnot diff --git a/EnvelopeGenerator.Web/Models/AnnotationParams.cs b/EnvelopeGenerator.Web/Models/AnnotationParams.cs index d52126f7..0a81004b 100644 --- a/EnvelopeGenerator.Web/Models/AnnotationParams.cs +++ b/EnvelopeGenerator.Web/Models/AnnotationParams.cs @@ -35,11 +35,11 @@ public class AnnotationParams if(DefaultAnnotation is not null) { // To set default value, annotation must have default (0) value but default must has non-default value - if (this[name]._left == default && DefaultAnnotation.Left != default) - this[name]._left = DefaultAnnotation.Left; + if (this[name]._marginLeft == default && DefaultAnnotation.MarginLeft != default) + this[name]._marginLeft = DefaultAnnotation.MarginLeft; - if (this[name]._top == default && DefaultAnnotation.Top != default) - this[name]._top = DefaultAnnotation.Top; + if (this[name]._marginTop == default && DefaultAnnotation.MarginTop != default) + this[name]._marginTop = DefaultAnnotation.MarginTop; if (this[name]._width == default && DefaultAnnotation.Width != default) this[name]._width = DefaultAnnotation.Width;