diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-04 11:09:41 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-04 21:36:58 +0100 |
commit | 14167171aff17b9bc4b5531fffd3f729e12f8a59 (patch) | |
tree | c15e56a4ec716f6cb83419cea37dc63f484859ab /serialize | |
parent | b16ab0038a0ec70c59a3bbfef4aa4dee0b04cf15 (diff) |
src: make anim_scale easier to construct
Diffstat (limited to 'serialize')
-rw-r--r-- | serialize/anim.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/serialize/anim.cpp b/serialize/anim.cpp index 42f39328..7be6323b 100644 --- a/serialize/anim.cpp +++ b/serialize/anim.cpp @@ -129,11 +129,11 @@ void adl_serializer<floormat::anim_scale>::from_json(const json& j, floormat::an { auto factor = (float)j[1]; fm_soft_assert(factor > 0 && factor <= 1); - val = { { .r = {factor} }, anim_scale_type::ratio }; + val = {factor}; } else if (bool is_width = type == "width"_s; is_width || type == "height"_s) { - val = { { .f = {is_width, (unsigned)j[1]} }, anim_scale_type::fixed }; + val = {(unsigned)j[1], is_width}; fm_soft_assert(val.f.width_or_height > 0); } else |