mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-26 03:40:07 +01:00
feat: tank tree svg cards ready
This commit is contained in:
1 parent
0d98e81a8f
commit
8c490edcc6
9 files changed
+139
-4
No files matched your search
@@ -0,0 +1,28 @@
|
||||
using Microsoft.JSInterop;
|
||||
using System.Threading.Tasks;
|
||||
using WotBlitzStatisticsPro.Blazor.Model;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace WotBlitzStatisticsPro.Blazor.Services
|
||||
{
|
||||
public class SvgHelper : ISvgHelper
|
||||
{
|
||||
private readonly IJSRuntime _jsRuntime;
|
||||
|
||||
public SvgHelper(IJSRuntime jsRuntime)
|
||||
{
|
||||
_jsRuntime = jsRuntime;
|
||||
}
|
||||
|
||||
public ElementDimensions CalculateTextBlockSize(string text, string fontFace, int fontSize)
|
||||
{
|
||||
var jsInProcess = (IJSInProcessRuntime)_jsRuntime;
|
||||
return jsInProcess.Invoke<ElementDimensions>("svgHelper.CalculateTextBlockDimensions", new
|
||||
{
|
||||
Text = text,
|
||||
Font = fontFace,
|
||||
Size = fontSize
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user