Bugfix: ui style merging should merge fonts as well
This commit is contained in:
parent
b37d2d25c7
commit
0b30163ed1
1 changed files with 7 additions and 0 deletions
|
|
@ -9,6 +9,12 @@ namespace psemek::ui
|
||||||
if (!dst) dst = src;
|
if (!dst) dst = src;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
void merge(std::shared_ptr<T> & dst, std::shared_ptr<T> const & src)
|
||||||
|
{
|
||||||
|
if (!dst) dst = src;
|
||||||
|
}
|
||||||
|
|
||||||
void merge(style & dst, style const & src)
|
void merge(style & dst, style const & src)
|
||||||
{
|
{
|
||||||
merge(dst.bg_color, src.bg_color);
|
merge(dst.bg_color, src.bg_color);
|
||||||
|
|
@ -24,6 +30,7 @@ namespace psemek::ui
|
||||||
merge(dst.text_color, src.text_color);
|
merge(dst.text_color, src.text_color);
|
||||||
merge(dst.text_scale, src.text_scale);
|
merge(dst.text_scale, src.text_scale);
|
||||||
merge(dst.text_shadow_offset, src.text_shadow_offset);
|
merge(dst.text_shadow_offset, src.text_shadow_offset);
|
||||||
|
merge(dst.font, src.font);
|
||||||
}
|
}
|
||||||
|
|
||||||
style default_style()
|
style default_style()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue