diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-08 12:04:14 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-08 12:04:52 +0100 |
commit | 0ab80a1322dd63ec30abc4170d69aa55a028a8fc (patch) | |
tree | 5aa8f94da97ad1a7790253d545f73685168a01e8 | |
parent | 5aeb836bbf71fcb1641d63e940282049d54d6fa5 (diff) |
serialize/wall-atlas: flip wall top's coordinates
This is user-visible so don't violate POLA.
-rw-r--r-- | serialize/wall-atlas.cpp | 6 | ||||
-rw-r--r-- | test/json/wall-atlas-02_groups.json | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/serialize/wall-atlas.cpp b/serialize/wall-atlas.cpp index 11ace967..8a495a5c 100644 --- a/serialize/wall-atlas.cpp +++ b/serialize/wall-atlas.cpp @@ -126,6 +126,12 @@ void write_direction_metadata(json& jdir, const Direction& dir) const auto& group = dir.*memfn; write_group_metadata(jdir[s], group); } + if (jdir.contains("top"s)) + { + auto& top = jdir["top"s]; + if (top.contains("pixel-size"s)) + top["pixel-size"s] = Vector2i{top["pixel-size"s]}.flipped(); + } } void write_info_header(json& jroot, const Info& info) diff --git a/test/json/wall-atlas-02_groups.json b/test/json/wall-atlas-02_groups.json index fe565acc..3c021733 100644 --- a/test/json/wall-atlas-02_groups.json +++ b/test/json/wall-atlas-02_groups.json @@ -13,7 +13,7 @@ "default-tint": true }, "top": { - "pixel-size": "42 x 192" + "pixel-size": "192 x 42" }, "overlay": { "pixel-size": "42 x 192", |