Ok, just checked and the issue is documentation - but maybe the label renderer should be smarter too.
halign/valign do align the element within its container. As a result, halign only works for v layouts, and valign only works for h.
But if you specify a size for the element that fills the container there is no room for alignment, so there is no effect. Once you have the element size set, the label is just rendered in the middle of that element, regardless of alignment requested
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Ok, just checked and the issue is documentation - but maybe the label renderer should be smarter too.
halign/valign do align the element within its container. As a result,
halign
only works forv
layouts, andvalign
only works forh
.But if you specify a size for the element that fills the container there is no room for alignment, so there is no effect. Once you have the element size set, the label is just rendered in the middle of that element, regardless of alignment requested