private void UpdatePaint() { if (_paint != null) { return; } var foreground = Brush .GetColorWithOpacity(Foreground, Colors.Transparent) .Value; var shader = Foreground is GradientBrush gb ? gb.GetShader(LayoutSlot.LogicalToPhysicalPixels()) : null; _paint = TextPaintPool.GetPaint( FontWeight, FontStyle, FontFamily, FontSize, CharacterSpacing, foreground, shader, BaseLineAlignment.Baseline, TextDecorations ); }
private void UpdatePaint() { if (_paint != null) { return; } _paint = TextPaintPool.GetPaint( FontWeight, FontStyle, FontFamily, FontSize, CharacterSpacing, (Foreground as SolidColorBrush)?.Color ?? Colors.Transparent, BaseLineAlignment.Baseline, TextDecorations ); }