Explorar el Código

fix filter bug

Michael Wang hace 3 años
padre
commit
4311200e51
Se han modificado 2 ficheros con 2 adiciones y 2 borrados
  1. 1 1
      src/features/mark/CommonMarkBody.vue
  2. 1 1
      src/utils/utils.ts

+ 1 - 1
src/features/mark/CommonMarkBody.vue

@@ -321,7 +321,7 @@ async function processSplitConfig() {
     .map<[number, number]>((v, index, ary) =>
       index % 2 === 0 ? [v, ary[index + 1]] : [0, 0]
     )
-    .filter((v) => v[0] === 0 && v[1] === 0);
+    .filter((v) => v[0] > 0 && v[1] > 0);
 
   // 最大的 splitConfig 的宽度
   const maxSplitConfig = Math.max(

+ 1 - 1
src/utils/utils.ts

@@ -219,7 +219,7 @@ export async function preDrawImage(_currentTask: Task) {
       .map<[number, number]>((v, index, ary) =>
         index % 2 === 0 ? [v, ary[index + 1]] : [0, 0]
       )
-      .filter((v) => v[0] === 0 && v[1] === 0);
+      .filter((v) => v[0] > 0 && v[1] > 0);
 
     const maxSplitConfig = Math.max(...store.setting.splitConfig);
     maxSliceWidth =