public LayoutMetrics ToClr() { return(new LayoutMetrics { ActualHeight = ActualHeight, ActualWidth = ActualWidth, LayoutSlot = LayoutSlot.ToClr(), VisualOffset = VisualOffset.ToClr(), LayoutClip = LayoutClip.ToClr(), HiddenDesire = HiddenDesire.ToClr(), DesiredSize = DesiredSize.ToClr(), RenderSize = RenderSize.ToClr(), AbsoluteXform = AbsoluteXform, LayoutXform = LayoutXform, LocalXform = LocalXform, RenderXform = RenderXform, TotalOpacity = TotalOpacity, TotalIsRenderVisible = TotalIsRenderVisible, TotalIsHitTestVisible = TotalIsHitTestVisible, TotalRenderProjection = TotalRenderProjection, }); }
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 ); }