diff --git a/src/k3menu.c b/src/k3menu.c index 6fa06f2..02b8d9c 100644 --- a/src/k3menu.c +++ b/src/k3menu.c @@ -254,7 +254,7 @@ static bool label_draw(struct k3MEvent *ev, uint8_t *ud) { if(va != k3M_ALIGN_TOP) { struct k3RectF txtsz; - k3FontSz(this->font, this->sz, this->txt, this->w, &txtsz); + k3FontSz(this->font, sz, this->txt, this->w, &txtsz); if(va == k3M_ALIGN_CENTER) { y += (this->h - txtsz.h) / 2; } else if(va == k3M_ALIGN_BOTTOM) { @@ -271,8 +271,12 @@ static bool label_draw(struct k3MEvent *ev, uint8_t *ud) { static bool label_measure(struct k3MEvent *ev, uint8_t *ud) { struct k3MLabel *this = (void*) ev->target; + float sz = this->sz; + struct k3MProperty *prop = k3MFindProperty(this, k3M_PROP_FONT_SIZE, false); + if(prop) sz = prop->f[0]; + struct k3RectF txtsz; - k3FontSz(this->font, this->sz, this->txt, -1, &txtsz); + k3FontSz(this->font, sz, this->txt, -1, &txtsz); this->w = ceilf(txtsz.w); this->h = ceilf(txtsz.h); @@ -282,8 +286,12 @@ static bool label_measure(struct k3MEvent *ev, uint8_t *ud) { static bool label_set_height_from_width(struct k3MEvent *ev, uint8_t *ud) { struct k3MLabel *this = (void*) ev->target; + float sz = this->sz; + struct k3MProperty *prop = k3MFindProperty(this, k3M_PROP_FONT_SIZE, false); + if(prop) sz = prop->f[0]; + int16_t pxsz[2]; - immdraw_font_size(this->font, this->sz, this->txt, this->w, pxsz); + immdraw_font_size(this->font, sz, this->txt, this->w, pxsz); this->h = pxsz[1];