Browse Source

处理窗口恢复

chenmy 3 years ago
parent
commit
90a275c78a

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

@@ -414,18 +414,18 @@ function drawText(stage, layer, paragraph, group, url, hierarchy, scalingY) {
             nowtext = nowtext + '\n'
             nowtext = nowtext + '\n'
             allText = nowtext
             allText = nowtext
         }
         }
+        console.log(textstyle.size, '渲染的字体大小')
                 var textName = new Konva.Text({
                 var textName = new Konva.Text({
                 x: 0,
                 x: 0,
                 y: 0,
                 y: 0,
                 text: allText,
                 text: allText,
-                width: textwidth * scalingY,
+                 width: textwidth * scalingY,
                 height: textheight * scalingY,
                 height: textheight * scalingY,
-                padding: pds * coefficient,
+               /* padding: pds * coefficient,*/
                 align: paragraph.textBody.paragraphs[0].style.hori.toLowerCase(),
                 align: paragraph.textBody.paragraphs[0].style.hori.toLowerCase(),
                 verticalAlign: paragraph.textBody.paragraphs[0].style.vert === "Center" ? "middle": paragraph.textBody.paragraphs[0].style.vert.toLowerCase(),
                 verticalAlign: paragraph.textBody.paragraphs[0].style.vert === "Center" ? "middle": paragraph.textBody.paragraphs[0].style.vert.toLowerCase(),
                /* verticalAlign: "bottom",*/
                /* verticalAlign: "bottom",*/
-                fontSize: paragraph.textBody.paragraphs.length !== 0 && textstyle.size != '0' ? textstyle.size * scalingY  : 18,
-               /* fontSize: 30,*/
+               fontSize: paragraph.textBody.paragraphs.length !== 0 && textstyle ? Number(textstyle.size * scalingY) : 18,
                 fontFamily: paragraph.textBody.paragraphs.length !== 0 && textstyle.family,
                 fontFamily: paragraph.textBody.paragraphs.length !== 0 && textstyle.family,
                 fill: paragraph.textBody.paragraphs.length !== 0 && textstyle.color ? textstyle.color :"#000000",
                 fill: paragraph.textBody.paragraphs.length !== 0 && textstyle.color ? textstyle.color :"#000000",
                 fontStyle: paragraph.textBody.paragraphs.length !== 0 && textstyle.bold === false ? 'normal' : 'bold',
                 fontStyle: paragraph.textBody.paragraphs.length !== 0 && textstyle.bold === false ? 'normal' : 'bold',

+ 5 - 3
HiTeachCC/ClientApp/src/views/Board.vue

@@ -25,7 +25,7 @@
             <!--<BoardLeft></BoardLeft>-->
             <!--<BoardLeft></BoardLeft>-->
             <ToolBox @handleToolPick="handleToolPick" @HiisShow="Hibtn" ref="hd"></ToolBox>
             <ToolBox @handleToolPick="handleToolPick" @HiisShow="Hibtn" ref="hd"></ToolBox>
             <div style="position:fixed;z-index: 1;">
             <div style="position:fixed;z-index: 1;">
-                <br />
+                <br/>
                 <Modal v-model="modalUpload" width="500" :mask-closable="false" style="margin-bottom:100px;bottom:unset !important">
                 <Modal v-model="modalUpload" width="500" :mask-closable="false" style="margin-bottom:100px;bottom:unset !important">
                     <div slot="footer" class="tc ov flex mgt">
                     <div slot="footer" class="tc ov flex mgt">
                         <div class="upload-box">
                         <div class="upload-box">
@@ -3667,10 +3667,12 @@ import { locale } from 'core-js'
             window.onresize = () => {
             window.onresize = () => {
                 return (() => {
                 return (() => {
                     /* this.screenWidth = document.body.clientWidth;*/
                     /* this.screenWidth = document.body.clientWidth;*/
-                    console.log(this.stage.size(),'获取现在的宽高')
+                    console.log(this.stage,'获取现在的宽高')
                     var size = this.stage.size();
                     var size = this.stage.size();
                     var scale = (window.innerHeight / size.height).toFixed(2)
                     var scale = (window.innerHeight / size.height).toFixed(2)
-                    var starting = (window.innerWidth - this.primevalInit.width * this.primevalInit.scale * scale) / 2
+                    var scaleData = scale <= 1 ? scale:1
+                    var starting = (window.innerWidth - this.primevalInit.width * this.primevalInit.scale * scaleData) / 2
+                    console.log(window.innerHeight, window.innerWidth, starting, this.primevalInit.width, this.primevalInit.scale, scale,'起点的位置')
                    /* this.stage.absolutePosition({ x: starting, y: 0 })*/
                    /* this.stage.absolutePosition({ x: starting, y: 0 })*/
                     this.stage.x(starting)
                     this.stage.x(starting)
                     this.primevalInit.x = starting
                     this.primevalInit.x = starting