Skip to content

Commit

Permalink
尝试修复部分地区svg图标不显示的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuYunPlayer committed May 19, 2024
1 parent 5b9588b commit c764721
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion TuneLab/GUI/SvgIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Avalonia.Svg.Skia;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Expand All @@ -12,7 +13,7 @@ internal class SvgIcon(string content)
{
public SvgImage GetImage(Color color)
{
return new SvgImage() { Source = SvgSource.LoadFromSvg(content.Replace("white", string.Format(rgba, color.R, color.G, color.B, color.A / 255.0))) };
return new SvgImage() { Source = SvgSource.LoadFromSvg(content.Replace("white", string.Format(rgba, color.R, color.G, color.B, (color.A / 255.0).ToString(new CultureInfo("zh-CN"))))) };
}

static readonly string rgba = "rgba({0},{1},{2},{3})";
Expand Down

0 comments on commit c764721

Please sign in to comment.