Przeglądaj źródła

Merge branch '2023-9-5_简谱和节奏'

liushengqiang 1 rok temu
rodzic
commit
be3e9cd2bb
2 zmienionych plików z 21 dodań i 10 usunięć
  1. 13 8
      src/pc/home/index.module.less
  2. 8 2
      src/pc/home/runtime.ts

+ 13 - 8
src/pc/home/index.module.less

@@ -27,16 +27,21 @@
             .abcjs-beam-elem {
                 transform: translateY(3px);
             }
+
+            .abcjs-rest path[data-name="rests.whole"] {
+                transform: translateY(8px);
+            }
         }
 
-        // svg .abcjs-staff{
-        //     path:nth-child(1),
-        //     path:nth-child(2),
-        //     path:nth-child(4),
-        //     path:nth-child(5){
-        //         opacity: 0;
-        //     }
-        // }
+        svg .abcjs-staff {
+
+            path:nth-child(1),
+            path:nth-child(2),
+            path:nth-child(4),
+            path:nth-child(5) {
+                opacity: 0;
+            }
+        }
     }
 }
 

+ 8 - 2
src/pc/home/runtime.ts

@@ -210,7 +210,11 @@ export const renderMeasures = (abc: IAbc, option?: IRenderMeasuresOption) => {
 		text += "%%barnumbers 1" + "\n";
 	}
 
-	abc.celf && (text += abc.celf + "\n");
+	if (abc.isrhythm === 'rhythm') {
+		text += "K:perc" + "\n";
+	} else {
+		abc.celf && (text += abc.celf + "\n");
+	}
 	abc.meter && (text += abc.meter + "\n");
 	abc.minUnit && (text += abc.minUnit + "\n");
 	abc.speed && (text += abc.speed + "\n");
@@ -250,7 +254,9 @@ export const renderMeasures = (abc: IAbc, option?: IRenderMeasuresOption) => {
 			}
 			text += playStr ?? ""; // 演奏技法
 			text += note.dynamics ?? ""; // 力度符号
-			text += note.accidental ?? ""; // 临时升降记号
+			if (abc.isrhythm !== 'rhythm') {
+				text += note.accidental ?? ""; // 临时升降记号
+			}
 			if (!note.content.includes('z') && abc.isrhythm === 'rhythm'){
 				text += "B";
 			} else {