Skip to content

Ports tg#85300: Add our_view to screen_loc_to_offset in view_audit_buttons #1050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 15, 2024
Merged

Ports tg#85300: Add our_view to screen_loc_to_offset in view_audit_buttons #1050

merged 1 commit into from
Aug 15, 2024

Conversation

francinum
Copy link
Member

tgstation/tgstation#85300

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

🆑 ShadowLarkens
fix: Fixed action buttons relative to EAST,SOUTH, or CENTER being improperly moved during view_audit_buttons()
/:cl:

@francinum francinum changed the title Add our_view to screen_loc_to_offset in view_audit_buttons Ports tg#85300: Add our_view to screen_loc_to_offset in view_audit_buttons Aug 3, 2024
@Kapu1178 Kapu1178 merged commit 691e0d5 into DaedalusDock:master Aug 15, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants