Add our_view to screen_loc_to_offset in view_audit_buttons (#85300)

## About The Pull Request

Relative positions are calculated incorrectly in widescreen mode without
this. To demonstrate, call
```
screen_loc_to_offset("EAST-4,SOUTH", null) = [-128,32]
```
When passed to offset_to_screen_loc, this will be clamped to (32,32)
```
offset_to_screen_loc(-128, 32, view = our_view) = "1,1"
``` 
And returned as 1,1 - moving the action button incorrectly.

By including our_view in the call to `screen_loc_to_offset`, this entire
problem is avoided.

## Why It's Good For The Game

If someone sets a floating action button to be relative to EAST, SOUTH,
or CENTER, they run into this bug. As far as I can tell, nothing
currently does this and therefore it isn't meaningful, but I've run into
this twice now downstream.
## Changelog
🆑
fix: Fixed action buttons relative to EAST,SOUTH, or CENTER being
improperly moved during view_audit_buttons()
/🆑
This commit is contained in:
ShadowLarkens
2024-08-14 12:50:53 +02:00
committed by GitHub
parent f67e4c5e9f
commit c67a85d375
+1 -1
View File
@@ -585,7 +585,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
listed_actions.check_against_view()
palette_actions.check_against_view()
for(var/atom/movable/screen/movable/action_button/floating_button as anything in floating_actions)
var/list/current_offsets = screen_loc_to_offset(floating_button.screen_loc)
var/list/current_offsets = screen_loc_to_offset(floating_button.screen_loc, our_view)
// We set the view arg here, so the output will be properly hemm'd in by our new view
floating_button.screen_loc = offset_to_screen_loc(current_offsets[1], current_offsets[2], view = our_view)