From 522c6ea14cd2c1569ce5ff24c0241edba1835308 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 2 Oct 2021 05:02:34 +0200 Subject: Revert tab style --- src/QuickMedia.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/QuickMedia.cpp') diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index cdf20f8..e63a5f2 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -3669,7 +3669,7 @@ namespace QuickMedia { redraw = false; if(error) { auto bounds = error_message.getLocalBounds(); - error_message.setPosition(vec2f_round(content_size.x * 0.5f - bounds.width * 0.5f, content_size.y * 0.5f - bounds.height)); + error_message.setPosition(vec2f_floor(content_size.x * 0.5f - bounds.width * 0.5f, content_size.y * 0.5f - bounds.height)); } else { sf::Vector2f image_scale; if(fit_image_to_window) @@ -3681,7 +3681,7 @@ namespace QuickMedia { auto image_size = texture_size_f; image_size.x *= image_scale.x; image_size.y *= image_scale.y; - image.setPosition(vec2f_round(content_size.x * 0.5f - image_size.x * 0.5f, content_size.y * 0.5f - image_size.y * 0.5f)); + image.setPosition(vec2f_floor(content_size.x * 0.5f - image_size.x * 0.5f, content_size.y * 0.5f - image_size.y * 0.5f)); } window.clear(get_theme().background_color); @@ -3697,7 +3697,7 @@ namespace QuickMedia { window.draw(chapter_text_background); auto text_bounds = chapter_text.getLocalBounds(); - chapter_text.setPosition(vec2f_round(window_size.x * 0.5f - text_bounds.width * 0.5f, window_size.y - bottom_panel_height * 0.5f - font_height * 0.5f)); + chapter_text.setPosition(vec2f_floor(window_size.x * 0.5f - text_bounds.width * 0.5f, window_size.y - bottom_panel_height * 0.5f - font_height * 0.5f)); window.draw(chapter_text); window.display(); @@ -4349,7 +4349,7 @@ namespace QuickMedia { redraw = false; comment_input.set_max_width(window_size.x - (logo_padding_x + logo_size.x + chat_input_padding_x + logo_padding_x)); - comment_input.set_position(vec2f_round(logo_padding_x + logo_size.x + chat_input_padding_x, chat_input_padding_y)); + comment_input.set_position(vec2f_floor(logo_padding_x + logo_size.x + chat_input_padding_x, chat_input_padding_y)); const float body_width = window_size.x; @@ -4390,7 +4390,7 @@ namespace QuickMedia { auto captcha_image_size = captcha_texture_size_f; captcha_image_size.x *= image_scale.x; captcha_image_size.y *= image_scale.y; - captcha_sprite.setPosition(vec2f_round(content_size.x * 0.5f - captcha_image_size.x * 0.5f, content_size.y * 0.5f - captcha_image_size.y * 0.5f)); + captcha_sprite.setPosition(vec2f_floor(content_size.x * 0.5f - captcha_image_size.x * 0.5f, content_size.y * 0.5f - captcha_image_size.y * 0.5f)); image_height = (int)captcha_image_size.y; if(has_captcha_bg && captcha_bg_texture.getNativeHandle() != 0) { @@ -4405,7 +4405,7 @@ namespace QuickMedia { image_size.x *= image_scale.x; image_size.y *= image_scale.y; const float width_diff = image_size.x - captcha_image_size.x; - captcha_bg_sprite.setPosition(vec2f_round(captcha_sprite.getPosition().x + width_diff*1.0f - captcha_slide*(width_diff + width_diff*2.0f), captcha_sprite.getPosition().y)); + captcha_bg_sprite.setPosition(vec2f_floor(captcha_sprite.getPosition().x + width_diff*1.0f - captcha_slide*(width_diff + width_diff*2.0f), captcha_sprite.getPosition().y)); window.draw(captcha_bg_sprite); image_height = std::max(image_height, (int)image_size.y); @@ -4427,7 +4427,7 @@ namespace QuickMedia { captcha_slide_bg.set_position(sf::Vector2f(captcha_sprite.getPosition().x, captcha_sprite.getPosition().y + image_height + 10.0f)); const sf::Vector2f captcha_slide_fg_size = captcha_slide_bg.get_size() - sf::Vector2f(captcha_slide_padding_x * 2.0f, captcha_slide_padding_y * 2.0f); - captcha_slide_fg.set_size(vec2f_round(captcha_slide_fg_size.x * captcha_slide, captcha_slide_fg_size.y)); + captcha_slide_fg.set_size(vec2f_floor(captcha_slide_fg_size.x * captcha_slide, captcha_slide_fg_size.y)); captcha_slide_fg.set_position(captcha_slide_bg.get_position() + sf::Vector2f(captcha_slide_padding_x, captcha_slide_padding_y)); if(has_captcha_bg) { @@ -4458,7 +4458,7 @@ namespace QuickMedia { auto image_size = texture_size_f; image_size.x *= image_scale.x; image_size.y *= image_scale.y; - attached_image_sprite.setPosition(vec2f_round(content_size.x * 0.5f - image_size.x * 0.5f, content_size.y * 0.5f - image_size.y * 0.5f)); + attached_image_sprite.setPosition(vec2f_floor(content_size.x * 0.5f - image_size.x * 0.5f, content_size.y * 0.5f - image_size.y * 0.5f)); window.draw(attached_image_sprite); } } else { @@ -4467,7 +4467,7 @@ namespace QuickMedia { auto content_size = window_size; auto rect_size = clamp_to_size(rect.getSize(), content_size); rect.setSize(rect_size); - rect.setPosition(vec2f_round(content_size.x * 0.5f - rect_size.x * 0.5f, content_size.y * 0.5f - rect_size.y * 0.5f)); + rect.setPosition(vec2f_floor(content_size.x * 0.5f - rect_size.x * 0.5f, content_size.y * 0.5f - rect_size.y * 0.5f)); window.draw(rect); load_sprite.setPosition(window_size.x * 0.5f, window_size.y * 0.5f); @@ -6550,7 +6550,7 @@ namespace QuickMedia { this->body_pos = sf::Vector2f(0.0f, tab_shade_height); if(window_size.x > 900.0f * get_config().scale * get_config().font_scale && show_room_side_panel) { - this->body_size = vec2f_round(300.0f * get_config().scale * get_config().font_scale, window_size.y - tab_shade_height); + this->body_size = vec2f_floor(300.0f * get_config().scale * get_config().font_scale, window_size.y - tab_shade_height); draw_room_list = true; } else { this->body_size = sf::Vector2f(0.0f, 0.0f); @@ -6564,7 +6564,7 @@ namespace QuickMedia { chat_input_shade.setPosition(body_pos.x, window_size.y - chat_input_shade.getSize().y); chat_input.set_max_width(window_size.x - (logo_padding_x + logo_size.x + chat_input_padding_x + logo_padding_x + body_pos.x)); - chat_input.set_position(vec2f_round(body_pos.x + logo_padding_x + logo_size.x + chat_input_padding_x, window_size.y - chat_height - chat_input_padding_y)); + chat_input.set_position(vec2f_floor(body_pos.x + logo_padding_x + logo_size.x + chat_input_padding_x, window_size.y - chat_height - chat_input_padding_y)); more_messages_below_rect.setSize(sf::Vector2f(chat_input_shade.getSize().x, gradient_height)); more_messages_below_rect.setPosition(chat_input_shade.getPosition().x, std::floor(window_size.y - chat_input_height_full - gradient_height)); @@ -7315,7 +7315,7 @@ namespace QuickMedia { redraw = false; loading_bar_background.set_size(sf::Vector2f(window_size.x - padding_x * 2.0f, loading_bar_height)); loading_bar_background.set_position(window_size * 0.5f - loading_bar_background.get_size() * 0.5f + sf::Vector2f(0.0f, download_speed_text.getLocalBounds().height * 0.5f)); - loading_bar_background.set_position(vec2f_round(loading_bar_background.get_position().x, loading_bar_background.get_position().y)); + loading_bar_background.set_position(vec2f_floor(loading_bar_background.get_position().x, loading_bar_background.get_position().y)); loading_bar.set_position(loading_bar_background.get_position() + sf::Vector2f(loading_bar_padding_x, loading_bar_padding_y)); filename_text.setPosition( loading_bar_background.get_position() + sf::Vector2f(0.0f, -(filename_text.getLocalBounds().height + spacing_y))); -- cgit v1.2.3