@lightningjs/blits 1.9.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/engines/L3/element.js +5 -4
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -31,26 +31,27 @@ const layoutFn = function (config) {
|
|
|
31
31
|
const children = this.children
|
|
32
32
|
const childrenLength = children.length
|
|
33
33
|
let otherDimension = 0
|
|
34
|
+
const gap = config.gap || 0
|
|
34
35
|
for (let i = 0; i < childrenLength; i++) {
|
|
35
36
|
const node = children[i]
|
|
36
37
|
node[xy] = offset
|
|
37
38
|
// todo: temporary text check, due to 1px width of empty text node
|
|
38
39
|
if (wh === 'width') {
|
|
39
|
-
offset += node.width + (node.width !== ('text' in node ? 1 : 0) ?
|
|
40
|
+
offset += node.width + (node.width !== ('text' in node ? 1 : 0) ? gap : 0)
|
|
40
41
|
} else if (wh === 'height') {
|
|
41
42
|
offset +=
|
|
42
43
|
'text' in node
|
|
43
44
|
? node.width > 1
|
|
44
|
-
? node.height +
|
|
45
|
+
? node.height + gap
|
|
45
46
|
: 0
|
|
46
47
|
: node.height !== 0
|
|
47
|
-
? node.height +
|
|
48
|
+
? node.height + gap
|
|
48
49
|
: 0
|
|
49
50
|
}
|
|
50
51
|
otherDimension = Math.max(otherDimension, node[opositeWh])
|
|
51
52
|
}
|
|
52
53
|
// adjust the size of the layout container
|
|
53
|
-
this[wh] = offset -
|
|
54
|
+
this[wh] = offset - gap
|
|
54
55
|
this[opositeWh] = otherDimension
|
|
55
56
|
}
|
|
56
57
|
|