We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 215a1c1 commit 09f6d44Copy full SHA for 09f6d44
lib/utils.js
@@ -34,6 +34,10 @@ var utils = {
34
},
35
36
calculateLineSize: function (line) {
37
+ if (line.size) {
38
+ return line.size;
39
+ }
40
+
41
var size = { height: 1, width: 0 };
42
line.forEach(function (outputEntry) {
43
var outputEntrySize = utils.calculateOutputEntrySize(outputEntry);
@@ -46,10 +50,13 @@ var utils = {
46
50
47
51
calculateSize: function (lines) {
48
52
var size = { height: 0, width: 0 };
49
- lines.forEach(function (line) {
53
+ lines.forEach(function (line, index) {
54
var lineSize = utils.calculateLineSize(line);
55
size.height += lineSize.height;
56
size.width = Math.max(size.width, lineSize.width);
57
+ if (index < lines.length - 1) {
58
+ line.size = lineSize;
59
60
});
61
return size;
62
0 commit comments