diff --git a/CHANGELOG.md b/CHANGELOG.md index a556cc7f..a7fb8992 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v1.9.1 + +_4 nov 2024_ + +- Added fix for omitting gap-attribute in Layout component + ## v1.9.0 _4 nov 2024_ diff --git a/package-lock.json b/package-lock.json index 4681276f..a64812bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@lightningjs/blits", - "version": "1.9.0", + "version": "1.9.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@lightningjs/blits", - "version": "1.9.0", + "version": "1.9.1", "license": "Apache-2.0", "dependencies": { "@lightningjs/msdf-generator": "^1.1.0", diff --git a/package.json b/package.json index 92980f80..a3947641 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lightningjs/blits", - "version": "1.9.0", + "version": "1.9.1", "description": "Blits: The Lightning 3 App Development Framework", "bin": "bin/index.js", "exports": { diff --git a/src/engines/L3/element.js b/src/engines/L3/element.js index 5db4f022..fd7333a2 100644 --- a/src/engines/L3/element.js +++ b/src/engines/L3/element.js @@ -31,26 +31,27 @@ const layoutFn = function (config) { const children = this.children const childrenLength = children.length let otherDimension = 0 + const gap = config.gap || 0 for (let i = 0; i < childrenLength; i++) { const node = children[i] node[xy] = offset // todo: temporary text check, due to 1px width of empty text node if (wh === 'width') { - offset += node.width + (node.width !== ('text' in node ? 1 : 0) ? config.gap : 0) + offset += node.width + (node.width !== ('text' in node ? 1 : 0) ? gap : 0) } else if (wh === 'height') { offset += 'text' in node ? node.width > 1 - ? node.height + config.gap + ? node.height + gap : 0 : node.height !== 0 - ? node.height + config.gap + ? node.height + gap : 0 } otherDimension = Math.max(otherDimension, node[opositeWh]) } // adjust the size of the layout container - this[wh] = offset - (config.gap || 0) + this[wh] = offset - gap this[opositeWh] = otherDimension }