koishi-plugin-vsinger-gacha 1.4.2 → 1.4.3
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 +7 -2
- package/package.json +1 -1
package/lib/render/kit.js
CHANGED
|
@@ -171,8 +171,13 @@ async function card(g, Canvas, o) {
|
|
|
171
171
|
if ((TIER[tier] || {}).tag && o.tagsDir && fs.existsSync(tagFile)) {
|
|
172
172
|
try {
|
|
173
173
|
const ti = await Canvas.loadImage(tagFile);
|
|
174
|
-
const tw = w * 0.
|
|
175
|
-
|
|
174
|
+
const tw = w * 0.52;
|
|
175
|
+
// ★ 贴边:裁进卡片圆角内,不留内边距
|
|
176
|
+
g.save();
|
|
177
|
+
roundRect(g, o.x, o.y, w, h, r);
|
|
178
|
+
g.clip();
|
|
179
|
+
g.drawImage(ti, o.x, o.y, tw, (ti.height / ti.width) * tw);
|
|
180
|
+
g.restore();
|
|
176
181
|
} catch { /* 忽略 */ }
|
|
177
182
|
}
|
|
178
183
|
if (o.laser && o.tagsDir) {
|