gui2: added Widget_GetBorderAndSpacing

This commit is contained in:
Martin Preuss
2026-04-08 23:53:51 +02:00
parent f0df0219a5
commit 9da5f71ce1

View File

@@ -506,6 +506,35 @@ Widget_AddOuterStyleBorders:
; ---------------------------------------------------------------------------
; @routine Widget_GetBorderAndSpacing @global
;
; @param Y address of widget
; @return r23 border size
; @return r22 spacing
; @clobbers none
Widget_GetBorderAndSpacing:
push zl
push zh
ldd zl, Y+WIDGET_OFFS_STYLE_LO
ldd zh, Y+WIDGET_OFFS_STYLE_HI
mov r22, zl
or r22, zh
brne Widget_GetBorderAndSpacing_read
clr r22
clr r23
rjmp Widget_GetBorderAndSpacing_done
Widget_GetBorderAndSpacing_read:
adiw zh:zl, WIDGET_STYLE_OFFS_OUTERBORDERSIZE
lpm r23, Z+ ; borders
lpm r22, Z ; spacing
Widget_GetBorderAndSpacing_done:
pop zh
pop zl
ret
; @end
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------