Skip to content

Commit

Permalink
Fix position of crewmate in "You have rescued a crew member!" box
Browse files Browse the repository at this point in the history
At first my CJK changes also misaligned this sprite, and my solution
that time was to position the textbox higher depending on the height
of the textbox, so it would be centered around the crewmate sprite
(which stayed at a hardcoded place onscreen). Recently, #987 changed
these sprites to be relative to the position of the textbox instead of
relative to the screen, which is much more logical, but it stopped
centering these sprites again. But it's an easy fix: simply account for
the extra-added height when adding the sprite in.
  • Loading branch information
Daaaav authored and InfoTeddy committed Nov 27, 2023
1 parent c9fd9e7 commit 61c5e18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion desktop_version/src/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ void Game::crewmate_textbox(const int color)
float spaces_per_8 = font::len(PR_FONT_INTERFACE, " ")/8.0f;
graphics.textboxpad(SDL_ceilf(5/spaces_per_8), SDL_ceilf(2/spaces_per_8));
graphics.textboxcenterx();
graphics.addsprite(14, 12, 0, color);
graphics.addsprite(14, 12 + extra_cjk_height/2, 0, color);
}

void Game::remaining_textbox(void)
Expand Down

0 comments on commit 61c5e18

Please sign in to comment.