Commit 0e4de1b3 by luyt

other:去除注释

1 parent 1066997a
...@@ -57,7 +57,7 @@ export const handlerFn = (str, originLen, line = 1) => { ...@@ -57,7 +57,7 @@ export const handlerFn = (str, originLen, line = 1) => {
* @returns {string} 截取后的字符串 * @returns {string} 截取后的字符串
*/ */
export function getStrByWith(desc, width, fontsize) { export function getStrByWith(desc, width, fontsize) {
console.log('desc: ', desc); // console.log('desc: ', desc);
var span = document.createElement('span') var span = document.createElement('span')
span.id = 'cut' span.id = 'cut'
span.style.visibility = 'hidden' span.style.visibility = 'hidden'
...@@ -70,7 +70,7 @@ export function getStrByWith(desc, width, fontsize) { ...@@ -70,7 +70,7 @@ export function getStrByWith(desc, width, fontsize) {
// desc是目标字符串, // desc是目标字符串,
temp += desc[j] temp += desc[j]
span.innerText = temp span.innerText = temp
console.log('span.offsetWidth', span.offsetWidth, width) // console.log('span.offsetWidth', span.offsetWidth, width)
if (span.offsetWidth > width) { if (span.offsetWidth > width) {
boo = true boo = true
break break
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!