@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.9.1
4
+
5
+ _4 nov 2024_
6
+
7
+ - Added fix for omitting gap-attribute in Layout component
8
+
3
9
  ## v1.9.0
4
10
 
5
11
  _4 nov 2024_
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightningjs/blits",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "Blits: The Lightning 3 App Development Framework",
5
5
  "bin": "bin/index.js",
6
6
  "exports": {
@@ -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) ? config.gap : 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 + config.gap
45
+ ? node.height + gap
45
46
  : 0
46
47
  : node.height !== 0
47
- ? node.height + config.gap
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 - (config.gap || 0)
54
+ this[wh] = offset - gap
54
55
  this[opositeWh] = otherDimension
55
56
  }
56
57