refactor(Annotation): Default.set hinzugefügt, um Standardwerte zu setzen
This commit is contained in:
@@ -29,26 +29,12 @@ public class AnnotationParams
|
||||
{
|
||||
_annots = value;
|
||||
|
||||
if (DefaultAnnotation is not null)
|
||||
foreach (var annot in _annots)
|
||||
annot.Default = DefaultAnnotation;
|
||||
|
||||
foreach (var name in Names)
|
||||
{
|
||||
#region set default values
|
||||
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]._marginLeft == default && DefaultAnnotation.MarginLeft != default)
|
||||
this[name]._marginLeft = DefaultAnnotation.MarginLeft;
|
||||
|
||||
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;
|
||||
|
||||
if (this[name]._height == default && DefaultAnnotation.Height != default)
|
||||
this[name]._height = DefaultAnnotation.Height;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region set bound annotations
|
||||
// horizontal
|
||||
if (this[name].HorBoundAnnotName is string horBoundAnnotName)
|
||||
|
||||
Reference in New Issue
Block a user