Skip to content

Commit

Permalink
MobileControls: Change m_mobile_controls_scale to int
Browse files Browse the repository at this point in the history
  • Loading branch information
Vankata453 committed Jul 15, 2024
1 parent f16abf0 commit 18d4876
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/control/mobile_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ MobileController::draw(DrawingContext& context)
m_mobile_controls_scale = g_config->mobile_controls_scale;

// Use screen height to calculate button size, because 20:9 screen ratios are common
const float BUTTON_SCALE = 0.05f * g_config->mobile_controls_scale;
const float BUTTON_SCALE = 0.05f * static_cast<float>(g_config->mobile_controls_scale);

m_rect_directions.set_size(height * BUTTON_SCALE * 4 / 3, height * BUTTON_SCALE);
m_rect_directions.set_pos(Vector(0, height - height * BUTTON_SCALE));
Expand Down
2 changes: 1 addition & 1 deletion src/control/mobile_controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class MobileController final
m_tex_jump, m_tex_action, m_tex_cheats, m_tex_debug;

int m_screen_width, m_screen_height;
float m_mobile_controls_scale;
int m_mobile_controls_scale;

private:
MobileController(const MobileController&) = delete;
Expand Down

0 comments on commit 18d4876

Please sign in to comment.