|
@@ -491,7 +491,7 @@
|
|
|
|
|
|
|
|
// --- 计算高度 ---
|
|
// --- 计算高度 ---
|
|
|
// 必须先设置字体,否则 measureText 计算不准确
|
|
// 必须先设置字体,否则 measureText 计算不准确
|
|
|
- ctx.font = 'bold 10px sans-serif';
|
|
|
|
|
|
|
+ ctx.font = 'bold 9px sans-serif';
|
|
|
let themeHeight = this.calculateWrappedTextHeight(ctx, item.theme, 14, leftW - 54 - 20);
|
|
let themeHeight = this.calculateWrappedTextHeight(ctx, item.theme, 14, leftW - 54 - 20);
|
|
|
|
|
|
|
|
ctx.font = '8px sans-serif';
|
|
ctx.font = '8px sans-serif';
|
|
@@ -503,7 +503,7 @@
|
|
|
// --- 绘制左侧文字 ---
|
|
// --- 绘制左侧文字 ---
|
|
|
// Theme Title
|
|
// Theme Title
|
|
|
ctx.fillStyle = dimensionData.titlecolor;
|
|
ctx.fillStyle = dimensionData.titlecolor;
|
|
|
- ctx.font = 'bold 10px sans-serif';
|
|
|
|
|
|
|
+ ctx.font = 'bold 9px sans-serif';
|
|
|
ctx.textAlign = 'left';
|
|
ctx.textAlign = 'left';
|
|
|
ctx.textBaseline = 'top';
|
|
ctx.textBaseline = 'top';
|
|
|
this.drawWrappedTextTop(ctx, item.theme, 10, startY, 14, leftW - 54 - 20);
|
|
this.drawWrappedTextTop(ctx, item.theme, 10, startY, 14, leftW - 54 - 20);
|
|
@@ -610,21 +610,6 @@
|
|
|
}
|
|
}
|
|
|
ctx.fillText(line, x, currentY);
|
|
ctx.fillText(line, x, currentY);
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- // 辅助函数:解析 CSS linear-gradient 字符串
|
|
|
|
|
- parseGradient(gradientString) {
|
|
|
|
|
- const colorStops = [];
|
|
|
|
|
- // 简化解析,仅适用于 "linear-gradient(90deg, #RRGGBB 0%, #RRGGBB 100%)" 格式
|
|
|
|
|
- const matches = gradientString.match(/#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})\s+(\d+)%/g);
|
|
|
|
|
- if (matches) {
|
|
|
|
|
- matches.forEach(match => {
|
|
|
|
|
- const parts = match.split(' ');
|
|
|
|
|
- colorStops.push({ color: parts[0], stop: parseInt(parts[1]) / 100 });
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- return colorStops;
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
calculateScaleAndPosition() {
|
|
calculateScaleAndPosition() {
|
|
|
uni.getSystemInfo({
|
|
uni.getSystemInfo({
|
|
|
success: (res) => {
|
|
success: (res) => {
|