@@ -330,59 +330,52 @@ private void DrawLit(CanvasDrawingSession cds, float w, float h, float pad, floa
330330 {
331331 if ( _intensity < 0.002 || _poolBrush is null ) break ;
332332
333- color . Transform = SweepTransform ( 0 , center , scale ) ;
334-
335333 float radius = ( float ) Math . Max ( 1 , Spot / 2 ) ;
336334 _poolBrush . Opacity = ( float ) _intensity ;
337335 _poolBrush . Center = _pool + new Vector2 ( pad , pad ) ;
338336 _poolBrush . RadiusX = radius ;
339337 _poolBrush . RadiusY = radius ;
340338
341- using ( cds . CreateLayer ( _poolBrush , ring ) )
342- {
343- cds . FillGeometry ( ring , color ) ;
344- }
339+ color . Opacity = 1f ;
340+ color . Transform = SweepTransform ( 0 , center , scale ) ;
341+ cds . FillGeometry ( ring , color , _poolBrush ) ;
345342 break ;
346343 }
347344
348345 case GlowingBorderKind . Beam :
349346 {
350- color . Transform = SweepTransform ( angleDegrees , center , scale ) ;
351- using ( cds . CreateLayer ( ( float ) BeamRestingOpacity , ring ) )
352- {
353- cds . FillGeometry ( ring , color ) ;
354- }
347+ var transform = SweepTransform ( angleDegrees , center , scale ) ;
348+
349+ color . Transform = transform ;
350+ color . Opacity = ( float ) BeamRestingOpacity ;
351+ cds . FillGeometry ( ring , color ) ;
355352
356353 if ( _beamBrush is not null )
357354 {
358- _beamBrush . Transform = SweepTransform ( angleDegrees , center , scale ) ;
359- using ( cds . CreateLayer ( _beamBrush , ring ) )
360- {
361- cds . FillGeometry ( ring , color ) ;
362- }
355+ _beamBrush . Transform = transform ;
356+ color . Opacity = 1f ;
357+ cds . FillGeometry ( ring , color , _beamBrush ) ;
363358 }
364359 break ;
365360 }
366361
367362 case GlowingBorderKind . Spin :
368363 {
364+ color . Opacity = 1f ;
369365 color . Transform = SweepTransform ( angleDegrees , center , scale ) ;
370366 cds . FillGeometry ( ring , color ) ;
371367 break ;
372368 }
373369
374370 default :
375371 {
372+ color . Opacity = breath ;
376373 color . Transform = SweepTransform ( 0 , center , scale ) ;
377- using ( cds . CreateLayer ( breath , ring ) )
378- {
379- cds . FillGeometry ( ring , color ) ;
380- }
374+ cds . FillGeometry ( ring , color ) ;
381375 break ;
382376 }
383377 }
384378 }
385-
386379 private static Matrix3x2 SweepTransform ( float angleDegrees , Vector2 center , float scale ) =>
387380 Matrix3x2 . CreateTranslation ( - SweepSize / 2f , - SweepSize / 2f )
388381 * Matrix3x2 . CreateScale ( scale )
0 commit comments