refactor(Annotation): Default.set hinzugefügt, um Standardwerte zu setzen
This commit is contained in:
@@ -71,4 +71,24 @@ public record Annotation
|
||||
[JsonIgnore]
|
||||
public Annotation? VerBoundAnnot { get; set; }
|
||||
#endregion
|
||||
|
||||
[JsonIgnore]
|
||||
internal Annotation Default
|
||||
{
|
||||
set
|
||||
{
|
||||
// To set default value, annotation must have default (0) value but default must has non-default value
|
||||
if (_marginLeft == default && value.MarginLeft != default)
|
||||
_marginLeft = value.MarginLeft;
|
||||
|
||||
if (_marginTop == default && value.MarginTop != default)
|
||||
_marginTop = value.MarginTop;
|
||||
|
||||
if (_width == default && value.Width != default)
|
||||
_width = value.Width;
|
||||
|
||||
if (_height == default && value.Height != default)
|
||||
_height = value.Height;
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user