fix Caption::size()

Also include margin space in computed size.
This commit is contained in:
Andrea Blankenstijn 2021-07-12 19:11:13 +02:00
parent fb1acc9386
commit 94002ddde3

View file

@ -90,6 +90,8 @@ abstract::Widget::Size widget::Caption::size() const
abstract::Widget::Size size;
TTF_SizeUTF8(_font, _text.c_str(), &size.w, &size.h);
size = {size.w + margins.w, size.h + margins.h};
return size;
}