+
+ let a = Infinity;
+ for(var k=itemsLength-2; this.lineCost(items, k+1,itemsLength-1, lineWidthFixed) < Infinity; k--){
+ let tmp = this.totalCostAux(items, k, lineWidthFixed);
+
+ if (a > tmp){
+ this.prevNodes[itemsLength-1] = k
+ a = tmp;
+ }
+ }
+
+ console.log("~~~", lineWidth);
+ console.log((<CharBox>items[itemsLength-2]));