refactor(Annotation): Umbenennen von left in marginLeft, top in marginTop, posX in Left und posY in top für eine CSS-ähnlichere Benennung

This commit is contained in:
Developer 02 2025-03-20 14:56:36 +01:00
parent 78b5e3f5cc
commit 14be46d3d6
2 changed files with 18 additions and 18 deletions

View File

@ -13,24 +13,24 @@ public record Annotation
#endregion #endregion
#region Layout #region Layout
internal double _left = default; internal double _marginLeft = default;
internal double _top = default; internal double _marginTop = default;
internal double _width = default; internal double _width = default;
internal double _height = default; internal double _height = default;
public double Left public double MarginLeft
{ {
get => _left; get => _marginLeft;
init => _left = value; init => _marginLeft = value;
} }
public double Top public double MarginTop
{ {
get => _top; get => _marginTop;
init => _top = value; init => _marginTop = value;
} }
public double Width public double Width
@ -46,16 +46,16 @@ public record Annotation
} }
#endregion #endregion
#region Pos #region Position
public double PosX => Left + (HorBoundAnnot?.HorBoundary ?? 0); public double Left => MarginLeft + (HorBoundAnnot?.HorBoundary ?? 0);
public double PosY => Top + (VerBoundAnnot?.VerBoundary ?? 0); public double Top => MarginTop + (VerBoundAnnot?.VerBoundary ?? 0);
#endregion #endregion
#region Boundary #region Boundary
public double HorBoundary => Left + Width; public double HorBoundary => MarginLeft + Width;
public double VerBoundary => Top + Height; public double VerBoundary => MarginTop + Height;
#endregion #endregion
#region BoundAnnot #region BoundAnnot

View File

@ -35,11 +35,11 @@ public class AnnotationParams
if(DefaultAnnotation is not null) if(DefaultAnnotation is not null)
{ {
// To set default value, annotation must have default (0) value but default must has non-default value // 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) if (this[name]._marginLeft == default && DefaultAnnotation.MarginLeft != default)
this[name]._left = DefaultAnnotation.Left; this[name]._marginLeft = DefaultAnnotation.MarginLeft;
if (this[name]._top == default && DefaultAnnotation.Top != default) if (this[name]._marginTop == default && DefaultAnnotation.MarginTop != default)
this[name]._top = DefaultAnnotation.Top; this[name]._marginTop = DefaultAnnotation.MarginTop;
if (this[name]._width == default && DefaultAnnotation.Width != default) if (this[name]._width == default && DefaultAnnotation.Width != default)
this[name]._width = DefaultAnnotation.Width; this[name]._width = DefaultAnnotation.Width;