From a290ccffc74bc95a45569e8b74e77be851d4a688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Rodr=C3=ADguez?= Date: Tue, 2 Apr 2024 08:16:14 -0600 Subject: [PATCH] Expose Blazor components dpi (#1832) --- .../SkiaSharp.Views.Blazor/SKCanvasView.razor.cs | 2 ++ source/SkiaSharp.Views/SkiaSharp.Views.Blazor/SKGLView.razor.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/source/SkiaSharp.Views/SkiaSharp.Views.Blazor/SKCanvasView.razor.cs b/source/SkiaSharp.Views/SkiaSharp.Views.Blazor/SKCanvasView.razor.cs index b1c7afa6a4..7d803f3496 100644 --- a/source/SkiaSharp.Views/SkiaSharp.Views.Blazor/SKCanvasView.razor.cs +++ b/source/SkiaSharp.Views/SkiaSharp.Views.Blazor/SKCanvasView.razor.cs @@ -60,6 +60,8 @@ public bool IgnorePixelScaling [Parameter(CaptureUnmatchedValues = true)] public IReadOnlyDictionary? AdditionalAttributes { get; set; } + public double Dpi => dpi; + protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender) diff --git a/source/SkiaSharp.Views/SkiaSharp.Views.Blazor/SKGLView.razor.cs b/source/SkiaSharp.Views/SkiaSharp.Views.Blazor/SKGLView.razor.cs index 6864aff219..6473fb1e8e 100644 --- a/source/SkiaSharp.Views/SkiaSharp.Views.Blazor/SKGLView.razor.cs +++ b/source/SkiaSharp.Views/SkiaSharp.Views.Blazor/SKGLView.razor.cs @@ -67,6 +67,8 @@ public bool IgnorePixelScaling [Parameter(CaptureUnmatchedValues = true)] public IReadOnlyDictionary? AdditionalAttributes { get; set; } + public double Dpi => dpi; + protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender)