Quellcode durchsuchen

小题明细分逐行偏移 bug fix

刘洋 vor 1 Jahr
Ursprung
Commit
40d83e4388
1 geänderte Dateien mit 2 neuen und 0 gelöschten Zeilen
  1. 2 0
      src/lib/watermark.ts

+ 2 - 0
src/lib/watermark.ts

@@ -80,6 +80,7 @@ export async function addWatermark(
     //最大宽/高限制
     //最大宽/高限制
     const fontSize = store.config.watermark.fontSize || 30;
     const fontSize = store.config.watermark.fontSize || 30;
     // const maxX = imageWidth / 2 - x * 2;
     // const maxX = imageWidth / 2 - x * 2;
+    const saveX = x;
     let dynamicX = x;
     let dynamicX = x;
     const maxStartX = imageWidth - fontSize * 0.7 * 5;
     const maxStartX = imageWidth - fontSize * 0.7 * 5;
     const nextLineStartX = x + fontSize * 0.7 * 4;
     const nextLineStartX = x + fontSize * 0.7 * 4;
@@ -132,6 +133,7 @@ export async function addWatermark(
           }, 0) / 100;
           }, 0) / 100;
         drawText(x, (y += height), `${mainNumber} |  ${mainTotalScore}`);
         drawText(x, (y += height), `${mainNumber} |  ${mainTotalScore}`);
         if (store.pageInputs["/image-download"].showSubScore) {
         if (store.pageInputs["/image-download"].showSubScore) {
+          dynamicX = saveX;
           drawText((dynamicX += fontSize * 0.7 * 5), y, ":");
           drawText((dynamicX += fontSize * 0.7 * 5), y, ":");
           for (let i = 0; i < arr.length; i++) {
           for (let i = 0; i < arr.length; i++) {
             const v = arr[i];
             const v = arr[i];