aboutsummaryrefslogtreecommitdiff
path: root/src/Body.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-11-05 15:46:10 +0100
committerdec05eba <dec05eba@protonmail.com>2023-11-05 15:46:10 +0100
commit7b2cd582f1f69f57c8f826ae8e0a7eadd6e33627 (patch)
treeb53898b9b33d875bfcc049aca54b98e50c3af656 /src/Body.cpp
parent5071a2428a35c4b2fed16c7f977e7448b02e3def (diff)
Add config option to set movement speed and icon spinning speed
Diffstat (limited to 'src/Body.cpp')
-rw-r--r--src/Body.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index 54a3b5f..e5a23b8 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -680,6 +680,7 @@ namespace QuickMedia {
return 0.0f;
}
+ // TODO: Remove this crap
if(is_touch_enabled()) {
const mgl::vec2f mouse_pos_diff(mouse_pos_raw.x - mouse_pos.x, mouse_pos_raw.y - mouse_pos.y);
const float move_speed = 35.0f;
@@ -769,7 +770,7 @@ namespace QuickMedia {
instant_move = true;
}
- const float speed = 30.0f;
+ const float speed = get_config().animation.move_speed;
const mgl::vec2f item_background_size_diff = mgl::vec2f(item_background_target_size.x, item_background_target_height) - item_background_prev_size;
const float item_background_size_speed = instant_move ? 1000.0f : speed;
@@ -1463,7 +1464,7 @@ namespace QuickMedia {
auto new_loading_icon_size = clamp_to_size(loading_icon_size, content_size);
loading_icon.set_position(item_pos + mgl::vec2f(body_spacing[body_theme].image_padding_x, padding_y) + (content_size * 0.5f));
loading_icon.set_scale(get_ratio(loading_icon_size, new_loading_icon_size));
- loading_icon.set_rotation(elapsed_time_sec * 400.0);
+ loading_icon.set_rotation(elapsed_time_sec * (double)get_config().animation.loading_icon_speed);
window.draw(loading_icon);
}
text_offset_x += body_spacing[body_theme].image_padding_x + item->loaded_image_size.x;
@@ -1601,7 +1602,7 @@ namespace QuickMedia {
auto new_loading_icon_size = clamp_to_size(loading_icon_size, content_size);
loading_icon.set_position(pos + pos_offset + mgl::vec2f(card_padding_x, card_padding_y) + mgl::vec2f(card_max_image_size.x, content_size.y) * 0.5f);
loading_icon.set_scale(get_ratio(loading_icon_size, new_loading_icon_size));
- loading_icon.set_rotation(elapsed_time_sec * 400.0);
+ loading_icon.set_rotation(elapsed_time_sec * (double)get_config().animation.loading_icon_speed);
window.draw(loading_icon);
}