From 409f2f2772b2c4250eb42dc030de9d1f930be1d9 Mon Sep 17 00:00:00 2001 From: "David Richards, Jr." Date: Thu, 3 Oct 2024 09:56:52 -0400 Subject: [PATCH] fix(InlineContent): remove extra spacing when using newline objects (#542) * fix(InlineContent): remove extra spacing when using newline objects * fix(InlineContent): clean up height logic --- .../src/components/InlineContent/InlineContent.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/@lightningjs/ui-components/src/components/InlineContent/InlineContent.js b/packages/@lightningjs/ui-components/src/components/InlineContent/InlineContent.js index 91cb45c09..c19a20a8b 100644 --- a/packages/@lightningjs/ui-components/src/components/InlineContent/InlineContent.js +++ b/packages/@lightningjs/ui-components/src/components/InlineContent/InlineContent.js @@ -161,9 +161,11 @@ export default class InlineContent extends Base { ) { let totalHeight = 0; this.flex._layout._lineLayouter._lines.forEach(line => { - totalHeight += Object.entries(line.items).sort((a, b) => { - return b[1].h - a[1].h; - })[0][1].h; + totalHeight += Object.entries(line.items) + .slice(line.startIndex, line.endIndex + 1) + .sort((a, b) => { + return b[1].h - a[1].h; + })[0][1].h; }); this.multiLineHeight = totalHeight;