koishi-plugin-vsinger-gacha 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/render/kit.js +24 -9
- package/package.json +1 -1
package/lib/render/kit.js
CHANGED
|
@@ -75,21 +75,36 @@ function header(g, o) {
|
|
|
75
75
|
const y = o.y;
|
|
76
76
|
const W = o.W;
|
|
77
77
|
|
|
78
|
-
//
|
|
79
|
-
const R = Math.max(
|
|
78
|
+
// 圆形图标:圆保持适中,音符用矢量画满圆内(避免字体 ♪ 上标很小)
|
|
79
|
+
const R = Math.max(24, Math.min(40, Math.round(W * 0.011)));
|
|
80
80
|
const cx = x + R;
|
|
81
|
-
const cy = y + R
|
|
81
|
+
const cy = y + R;
|
|
82
82
|
g.save();
|
|
83
83
|
g.beginPath();
|
|
84
84
|
g.arc(cx, cy, R, 0, Math.PI * 2);
|
|
85
85
|
g.fillStyle = COLOR.accent;
|
|
86
86
|
g.fill();
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
g.
|
|
87
|
+
|
|
88
|
+
// 音符:椭圆头 + 竖杆 + 旗
|
|
89
|
+
const k = R * 0.52; // 音符整体缩放
|
|
90
|
+
const hx = cx - k * 0.34; // 符头中心
|
|
91
|
+
const hy = cy + k * 0.52;
|
|
92
|
+
g.fillStyle = '#ffffff';
|
|
93
|
+
g.beginPath();
|
|
94
|
+
g.ellipse(hx, hy, k * 0.42, k * 0.32, -0.35, 0, Math.PI * 2);
|
|
95
|
+
g.fill();
|
|
96
|
+
|
|
97
|
+
// 竖杆
|
|
98
|
+
const sx = hx + k * 0.36;
|
|
99
|
+
g.fillRect(sx - k * 0.07, cy - k * 0.62, k * 0.14, hy - (cy - k * 0.62));
|
|
100
|
+
|
|
101
|
+
// 旗
|
|
102
|
+
g.beginPath();
|
|
103
|
+
g.moveTo(sx, cy - k * 0.62);
|
|
104
|
+
g.quadraticCurveTo(sx + k * 0.62, cy - k * 0.48, sx + k * 0.46, cy - k * 0.10);
|
|
105
|
+
g.quadraticCurveTo(sx + k * 0.52, cy - k * 0.40, sx, cy - k * 0.34);
|
|
106
|
+
g.closePath();
|
|
107
|
+
g.fill();
|
|
93
108
|
g.restore();
|
|
94
109
|
|
|
95
110
|
g.textBaseline = 'top';
|