Testing is almost complete, but now I'm in the area where it's a lot of interaction and probably need mocks or a way to inject keys to the gui.

This commit is contained in:
Zed A. Shaw 2024-12-02 10:57:02 -05:00
parent 2576b16869
commit 48df9248b2
5 changed files with 51 additions and 11 deletions

View file

@ -44,7 +44,7 @@ sf::Sprite &SFMLRender::get_text_sprite(wchar_t tile) {
}
bool SFMLRender::resize_grid(int new_size, Panel &panel_out) {
void SFMLRender::resize_grid(int new_size, Panel &panel_out) {
auto glyph = $font.getGlyph($config.bg_tile, new_size, false);
int view_x = std::ceil(($config.video_x - panel_out.x) / glyph.bounds.width);
int view_y = std::ceil(($config.video_y - panel_out.y) / glyph.bounds.height);
@ -57,7 +57,6 @@ bool SFMLRender::resize_grid(int new_size, Panel &panel_out) {
$bg_sprite = get_text_sprite($config.bg_tile);
$bg_bounds = $bg_sprite.getLocalBounds();
panel_out.resize(view_x, view_y);
return true;
}
inline void configure_tile(const sf::Sprite &sprite, sf::FloatRect &sp_bounds, sf::FloatRect bg_bounds, float &width_delta, float &height_delta) {