diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-01 17:23:27 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-01 17:23:27 +0100 |
commit | 257c2420545eb632a53c0fe3cd317be613dcb272 (patch) | |
tree | 95dfb97898f84ea60b293e60453bef1c57088fa4 /src/scenery.cpp | |
parent | f6aed5a3ae2e6b2b2eb822deee0a579ca66cd13f (diff) |
editor: update bboxes from a central place
Diffstat (limited to 'src/scenery.cpp')
-rw-r--r-- | src/scenery.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/scenery.cpp b/src/scenery.cpp index 86ebea73..f21f95c2 100644 --- a/src/scenery.cpp +++ b/src/scenery.cpp @@ -66,13 +66,15 @@ scenery::scenery(door_tag_t, const anim_atlas& atlas, rotation r, bool is_open, void scenery_ref::rotate(rotation new_r) { - auto& s = frame; - s.bbox_offset = rotate_point(s.bbox_offset, s.r, new_r); - s.bbox_size = rotate_size(s.bbox_size, s.r, new_r); - s.r = new_r; + c->with_scenery_bbox_update(idx, [&] { + auto& s = frame; + s.bbox_offset = rotate_point(s.bbox_offset, s.r, new_r); + s.bbox_size = rotate_size(s.bbox_size, s.r, new_r); + s.r = new_r; + }); } -bool scenery_ref::can_activate() noexcept +bool scenery_ref::can_activate() const noexcept { return frame.interactive; } |