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.
Files changed (2) hide show
  1. package/lib/render/kit.js +24 -9
  2. 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(26, Math.min(64, Math.round(W * 0.015)));
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 + 2;
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
- g.fillStyle = '#fff';
88
- g.font = `bold ${Math.round(R * 1.15)}px ${FONT}`;
89
- g.textAlign = 'center';
90
- g.textBaseline = 'middle';
91
- g.fillText('♪', cx, cy + Math.round(R * 0.04));
92
- g.textAlign = 'left';
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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koishi-plugin-vsinger-gacha",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "VSinger 收藏集抽卡 / 签到积分 / 图鉴(Koishi 插件,一次性安装)",
5
5
  "main": "lib/index.js",
6
6
  "files": [