示例#1
0
        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
                );
        }
示例#2
0
        private void UpdatePaint()
        {
            if (_paint != null)
            {
                return;
            }

            _paint = TextPaintPool.GetPaint(
                FontWeight,
                FontStyle,
                FontFamily,
                FontSize,
                CharacterSpacing,
                (Foreground as SolidColorBrush)?.Color ?? Colors.Transparent,
                BaseLineAlignment.Baseline,
                TextDecorations
                );
        }