From 9d1660270272180cd71147d6ddd53d1382643d2e Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 18:00:14 +0800
Subject: [PATCH] merge: 并入远程 Initial commit 作为历史根节点
---
Plugin.TestResult/Util/FontSizeConverter.cs | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/Plugin.TestResult/Util/FontSizeConverter.cs b/Plugin.TestResult/Util/FontSizeConverter.cs
new file mode 100644
index 0000000..7d1d61e
--- /dev/null
+++ b/Plugin.TestResult/Util/FontSizeConverter.cs
@@ -0,0 +1,33 @@
+锘縰sing System;
+using System.Globalization;
+using System.Windows.Data;
+
+namespace Plugin.TestResult_WPF
+{
+ public class FontSizeConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (parameter == null) return 15;
+
+ string[] ps = parameter.ToString().Split(',');
+ int size = int.Parse(ps[0]);
+ int baseSize = int.Parse(ps[1]);
+ if (value is double width)
+ {
+ return CountFontSize(size, width, baseSize);
+ }
+ return 15;
+ }
+
+ public static double CountFontSize(double size, double limit, double baseSize)
+ {
+ return size * limit / baseSize;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
--
Gitblit v1.9.1