lifuxiong vor 4 Jahren
Ursprung
Commit
31feb4a3cb
2 geänderte Dateien mit 1 neuen und 6 gelöschten Zeilen
  1. 1 5
      components/painter/lib/pen.js
  2. 0 1
      components/painter/painter.js

+ 1 - 5
components/painter/lib/pen.js

@@ -371,18 +371,15 @@ export default class Painter {
       while (
         start + alreadyCount <= view.text.length &&
         (width - measuredWith > view.css.fontSize.toPx() ||
-          (measuredWith > width && !isStop))
+          measuredWith > width)
       ) {
         if (measuredWith < width) {
-          console.log("+++++++++", view.css.fontSize);
           text = view.text.substr(start, ++alreadyCount);
         } else {
           if (text.length <= 1) {
             // 如果只有一个字符时,直接跳出循环
             break;
           }
-          console.log("---------", view.css.fontSize);
-
           text = view.text.substr(start, --alreadyCount);
         }
         measuredWith = this.ctx.measureText(text).width;
@@ -400,7 +397,6 @@ export default class Painter {
         text += "...";
         measuredWith = this.ctx.measureText(text).width;
       }
-      console.log("ssss====", text, measuredWith);
       this.ctx.setTextAlign(view.css.align ? view.css.align : "left");
       let x;
       switch (view.css.align) {

+ 0 - 1
components/painter/painter.js

@@ -113,7 +113,6 @@ Component({
         let preCount = 0;
         let completeCount = 0;
         const paletteCopy = JSON.parse(JSON.stringify(this.properties.palette));
-        console.log("sssss====", paletteCopy);
         if (paletteCopy.background) {
           preCount++;
           downloader.download(paletteCopy.background).then(