@@ -184,6 +184,7 @@ public static implicit operator LengthProperty(string value)
184184 if ( value . Contains ( "px" ) ) return new LengthProperty ( number . Parse ( value . ToLower ( ) . Replace ( "px" , "" ) , culture ) , Unit . Pixel ) ;
185185 if ( value . Contains ( "deg" ) ) return new LengthProperty ( number . Parse ( value . ToLower ( ) . Replace ( "deg" , "" ) , culture ) , Unit . Degrees ) ;
186186 if ( value . Contains ( '%' ) ) return new LengthProperty ( number . Parse ( value . Replace ( "%" , "" ) , culture ) , Unit . Percent ) ;
187+
187188 return default ;
188189 }
189190 public static implicit operator string ( LengthProperty value )
@@ -311,6 +312,7 @@ public static implicit operator string(ColorProperty value)
311312 if ( value . rgb . NotNullOrEmpty ( ) ) return value . rgb ;
312313 if ( value . hex . NotNullOrEmpty ( ) ) return value . hex ;
313314 if ( value . name . NotNullOrEmpty ( ) ) return value . name ;
315+
314316 return "initial" ;
315317 }
316318 public override string ToString ( ) => this ;
@@ -354,6 +356,7 @@ public static implicit operator string(AssetProperty value)
354356 {
355357 if ( value . url . NotNullOrEmpty ( ) ) return value . url ;
356358 if ( value . resource . NotNullOrEmpty ( ) ) return value . resource ;
359+
357360 return value . unit switch
358361 {
359362 Unit . None => "none" ,
@@ -1023,6 +1026,7 @@ void AddRotation()
10231026 if ( ( layout . relativeTransform [ 0 ] [ 0 ] == 1 && layout . relativeTransform [ 0 ] [ 0 ] == 0 &&
10241027 layout . relativeTransform [ 0 ] [ 0 ] == 0 && layout . relativeTransform [ 1 ] [ 1 ] == 1 ) || ! layout . relativeTransform [ 0 ] [ 0 ] . HasValue ||
10251028 ! layout . relativeTransform [ 0 ] [ 1 ] . HasValue || ! layout . relativeTransform [ 1 ] [ 0 ] . HasValue || ! layout . relativeTransform [ 1 ] [ 1 ] . HasValue ) return ;
1029+
10261030 float m00 = ( float ) layout . relativeTransform [ 0 ] [ 0 ] . Value ;
10271031 float m01 = ( float ) layout . relativeTransform [ 0 ] [ 1 ] . Value ;
10281032 int rotation = Mathf . RoundToInt ( Mathf . Rad2Deg * Mathf . Acos ( m00 / Mathf . Sqrt ( m00 * m00 + m01 * m01 ) ) ) ;
@@ -1046,6 +1050,7 @@ void AddRotation()
10461050 AddFillStyle ( mixin . fills ) ;
10471051
10481052 if ( mixin . strokes . Length == 0 ) return ;
1053+
10491054 AddStrokeFillStyle ( mixin . strokes ) ;
10501055
10511056 if ( ! mixin . strokeWeight . HasValue ) return ;
@@ -1069,9 +1074,11 @@ void AdjustSvgSize()
10691074 layout . absoluteBoundingBox = new Rect ( layout . absoluteBoundingBox . x , layout . absoluteBoundingBox . y , width , height ) ;
10701075
10711076 if ( geometry . strokes . Length == 0 || geometry . strokeWeight is not > 0 ) return ;
1077+
10721078 layout . absoluteBoundingBox = new Rect ( layout . absoluteBoundingBox . x - geometry . strokeWeight . Value / 2 , layout . absoluteBoundingBox . y , layout . absoluteBoundingBox . width , layout . absoluteBoundingBox . height ) ;
10731079
10741080 if ( geometry . strokeCap is null or StrokeCap . NONE ) return ;
1081+
10751082 layout . absoluteBoundingBox = new Rect ( layout . absoluteBoundingBox . x , layout . absoluteBoundingBox . y - geometry . strokeWeight . Value / 2 , layout . absoluteBoundingBox . width , layout . absoluteBoundingBox . height ) ;
10761083 }
10771084 void AddSizeByParentAutoLayoutFromAutoLayout ( DefaultFrameMixin frame )
@@ -1531,11 +1538,13 @@ string Get1(string name, string group, int index)
15311538 }
15321539
15331540 if ( Has ( name ) ) return attributes [ name ] ;
1541+
15341542 throw new NotSupportedException ( ) ;
15351543 }
15361544 string Get4 ( string name , params string [ ] names )
15371545 {
15381546 if ( Has ( name ) ) return attributes [ name ] ;
1547+
15391548 LengthProperty [ ] properties = new LengthProperty [ 4 ] ;
15401549 for ( int i = 0 ; i < 4 ; ++ i )
15411550 {
@@ -1632,6 +1641,7 @@ public UssWriter(IEnumerable<UssStyle> styles, IEnumerable<UssStyle> components,
16321641 void Write ( UssStyle style )
16331642 {
16341643 if ( ! style . HasAttributes ) return ;
1644+
16351645 if ( count > 0 )
16361646 {
16371647 uss . WriteLine ( ) ;
@@ -2046,6 +2056,7 @@ void AddImageFillsRecursively(BaseNode node, Func<BaseNode, bool> enabledInHiera
20462056 if ( ! enabledInHierarchy ( node ) ) return ;
20472057
20482058 if ( node is BooleanOperationNode ) return ;
2059+
20492060 if ( ! IsSvgNode ( node ) && HasImageFill ( node ) ) ImageFillNodes . Add ( node ) ;
20502061
20512062 if ( node is ChildrenMixin children )
@@ -2103,6 +2114,7 @@ void AddGradientsRecursively(BaseNode node, Func<BaseNode, bool> enabledInHierar
21032114 }
21042115
21052116 if ( node is not ChildrenMixin children ) return ;
2117+
21062118 foreach ( SceneNode child in children . children )
21072119 AddGradientsRecursively ( child , enabledInHierarchy ) ;
21082120 }
@@ -2194,6 +2206,7 @@ BaseNode Find(BaseNode root)
21942206 UssStyle GetStyle ( BaseNode node )
21952207 {
21962208 if ( componentStyleMap . TryGetValue ( node , out UssStyle style ) ) return style ;
2209+
21972210 return nodeStyleMap . TryGetValue ( node , out style ) ? style : default ;
21982211 }
21992212 void InheritStylesRecursively ( BaseNode node )
@@ -2328,6 +2341,7 @@ string GetClassList(BaseNode node)
23282341 static bool IsVisible ( BaseNodeMixin mixin )
23292342 {
23302343 if ( mixin is SceneNodeMixin scene && scene . visible . HasValueAndFalse ( ) ) return false ;
2344+
23312345 return mixin . parent is null || IsVisible ( mixin . parent ) ;
23322346 }
23332347 static bool HasImageFill ( BaseNodeMixin mixin ) => mixin is GeometryMixin geometry && geometry . fills . Any ( x => x is ImagePaint ) ;
0 commit comments