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);
a = tmp;
}
}
- console.log("~~~", lineWidth);
- console.log(items[itemsLength - 2]);
return a;
}
/**
this.totalCostAuxStorage[j] = returnCost;
return returnCost;
}
- return returnCost;
}
/**
* check the line cost of a line containing items[i..j]
* @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])) {