Selaa lähdekoodia

处理文字渲染 横 竖 向

chenmy 3 vuotta sitten
vanhempi
commit
02e61eb4e3
1 muutettua tiedostoa jossa 4 lisäystä ja 2 poistoa
  1. 4 2
      HiTeachCC/ClientApp/src/plugin/PublicRenderer.js

+ 4 - 2
HiTeachCC/ClientApp/src/plugin/PublicRenderer.js

@@ -415,12 +415,14 @@ function drawText(stage, layer, paragraph, group, url, hierarchy, scalingY) {
             allText = nowtext
         }
         console.log(textstyle.size, '渲染的字体大小')
+        let textScla = paragraph.textBody.vert === "EastAsianVetical" ? 1 : scalingY
+        lineHeights = paragraph.textBody.vert === "EastAsianVetical" ? 1 : lineHeights
                 var textName = new Konva.Text({
                 x: 0,
                 y: 0,
                 text: allText,
-                 width: textwidth * scalingY,
-                height: textheight * scalingY,
+                width: textwidth * textScla,
+                    height: textheight * scalingY,
                /* padding: pds * coefficient,*/
                 align: paragraph.textBody.paragraphs[0].style.hori.toLowerCase(),
                 verticalAlign: paragraph.textBody.paragraphs[0].style.vert === "Center" ? "middle": paragraph.textBody.paragraphs[0].style.vert.toLowerCase(),