X-Git-Url: https://git.kianting.info/?a=blobdiff_plain;f=src%2Flibclo%2FbreakLines.js;h=c7319be170a726b1e7d95b78e2bef42a1f1aa272;hb=714bbb4a64531268d17ca8f7ae60800ec2046a27;hp=f194aa5657eb8cb9edc734418cb0fbe1afc95d13;hpb=ea033498d79b3a84b16e15ff2a218ac5ef5f70b5;p=clo diff --git a/src/libclo/breakLines.js b/src/libclo/breakLines.js index f194aa5..c7319be 100644 --- a/src/libclo/breakLines.js +++ b/src/libclo/breakLines.js @@ -34,6 +34,11 @@ class BreakLineAlgorithm { return item.width; } } + /**segement node of one paragraph into lines. + * @args items: nodes of a line + * @args linewidth: the line width + * @returns segmented nodes into lines + */ segmentedNodes(items, lineWidth) { let lineWidthFixed = lineWidth; this.totalCost(items, lineWidthFixed); @@ -88,8 +93,6 @@ class BreakLineAlgorithm { a = tmp; } } - console.log("~~~", lineWidth); - console.log(items[itemsLength - 2]); return a; } /** @@ -119,7 +122,6 @@ class BreakLineAlgorithm { this.totalCostAuxStorage[j] = returnCost; return returnCost; } - return returnCost; } /** * check the line cost of a line containing items[i..j] @@ -129,7 +131,8 @@ class BreakLineAlgorithm { * @param lineWidth line width */ lineCost(items, i, j, lineWidth) { - if (this.lineCostStorage[i] !== null && this.lineCostStorage[i][j] !== null) { + if (this.lineCostStorage[i][j] !== null) { + console.log("AA"); return this.lineCostStorage[i][j]; } if (!this.isBreakPoint(items[j])) {