浏览代码

Merge branch 'feature-tianyong' into gym-test

TIANYONG 8 月之前
父节点
当前提交
df5b6ad0c1
共有 3 个文件被更改,包括 11 次插入7 次删除
  1. 4 2
      src/helpers/svgToPng.ts
  2. 1 1
      src/view/music-score/index.tsx
  3. 6 4
      src/view/selection/index.module.less

+ 4 - 2
src/helpers/svgToPng.ts

@@ -3,16 +3,18 @@ export const getSvgPngToSize = (osmd: any) => {
     if (osmd) {
       if (osmd.Drawer.Backends.length > 0) {
         var imgList = []
-
+        
         for (var idx = 0, len = osmd.Drawer.Backends.length; idx < len; idx++) {
           var backend = osmd.Drawer.Backends[idx]
           var state = backend.ctx.state;
           var width = backend.ctx.width / state.scale.x;
           var height = backend.ctx.height / state.scale.y;
+          const textX = width - 120,textY = height - 50;
+          const textDom = `<g><text x="${textX}" y="${textY}" stroke-width="3" fill="#000000" stroke="none" stroke-dasharray="none" font-family="Times New Roman" font-size="36px" font-weight="bold" font-style="none">第${idx+1}页</text></g>`
+          backend.ctx.svg.innerHTML = backend.ctx.svg.innerHTML + textDom;
           var cont = new XMLSerializer().serializeToString(
             backend.ctx.svg
           )
-
           imgList.push({
             img: cont,
             width: width,

+ 1 - 1
src/view/music-score/index.tsx

@@ -173,7 +173,7 @@ export default defineComponent({
 				}
 			}
 			if (query.downPng === 'A4') {
-				osmd.setPageFormat('794x1070')
+				osmd.setPageFormat('794x1100')
 				osmd.zoom = 0.3;
 			} else {
 				osmd.zoom = state.zoom;

+ 6 - 4
src/view/selection/index.module.less

@@ -392,7 +392,7 @@
     :global {
         .node-dot::before{
             height: 120PX;
-            width: 3PX;
+            width: 4PX;
         }
     }
 }
@@ -405,7 +405,7 @@
     :global {
         .node-dot::before{
             height: 140PX;
-            width: 3PX;
+            width: 4PX;
         }
     }
 }
@@ -413,12 +413,13 @@
 .smallZoom {
     .line {
         height: 45PX;
+        min-height: 45PX;
         width: 1PX;
     }
     :global {
         .node-dot::before{
             height: 45PX;
-            width: 1PX;
+            width: 2PX;
         }
     }
 }
@@ -426,12 +427,13 @@
 .litteZoom {
     .line {
         height: 35PX;
+        min-height: 35PX;
         width: 1PX;
     }
     :global {
         .node-dot::before{
             height: 35PX;
-            width: 1PX;
+            width: 2PX;
         }
     }
 }