From 12cdc6c63764bca6f2d02fdf930903e9d4f7c4cb Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Thu, 9 Apr 2026 00:00:36 +0200 Subject: [PATCH] gui2: resize item if WIDGET_PACK_FILLED --- avr/modules/lcd2/gui2/base/layout2.asm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/avr/modules/lcd2/gui2/base/layout2.asm b/avr/modules/lcd2/gui2/base/layout2.asm index 8aff530..82241bb 100644 --- a/avr/modules/lcd2/gui2/base/layout2.asm +++ b/avr/modules/lcd2/gui2/base/layout2.asm @@ -380,6 +380,8 @@ layoutCtxPack: breq layoutCtxPack_end cpi r25, WIDGET_PACK_CENTER breq layoutCtxPack_center + cpi r25, WIDGET_PACK_FILLED + breq layoutCtxPack_filled rjmp layoutCtxPack_store layoutCtxPack_end: add r18, r16 ; just add difference to pos @@ -390,6 +392,14 @@ layoutCtxPack_center: ror r16 add r18, r16 ; just add half difference to pos adc r19, r17 + rjmp layoutCtxPack_store +layoutCtxPack_filled: + add r16, r20 ; get size back into r17:r16 + adc r17, r21 + adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_SIZE_LO + st X+, r16 ; set item to full size + st X, r17 + sbiw xh:xl, (LAYOUT_CTX_ITEM_OFFS_SIZE_LO+1) layoutCtxPack_store: adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_POS_LO st X+, r18