aboutsummaryrefslogtreecommitdiff
path: root/src/Entry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Entry.cpp')
-rw-r--r--src/Entry.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Entry.cpp b/src/Entry.cpp
index ce86f8f..771e2fd 100644
--- a/src/Entry.cpp
+++ b/src/Entry.cpp
@@ -5,20 +5,20 @@
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/RectangleShape.hpp>
#include <SFML/Window/Event.hpp>
-#include <cmath>
-
-const float background_margin_horizontal = std::floor(5.0f * QuickMedia::get_ui_scale());
-const float padding_vertical = std::floor(5.0f * QuickMedia::get_ui_scale());
-const float background_margin_vertical = std::floor(0.0f * QuickMedia::get_ui_scale());
+#include <math.h>
namespace QuickMedia {
+ static const float background_margin_horizontal = std::floor(5.0f * get_ui_scale());
+ static const float padding_vertical = std::floor(5.0f * get_ui_scale());
+ static const float background_margin_vertical = std::floor(0.0f * get_ui_scale());
+
Entry::Entry(const std::string &placeholder_text, sf::Shader *rounded_rectangle_shader) :
on_submit_callback(nullptr),
draw_background(true),
- text("", false, std::floor(16 * get_ui_scale()), 0.0f),
+ text("", false, std::floor(16 * get_ui_scale() * get_font_scale()), 0.0f),
width(0.0f),
background(sf::Vector2f(1.0f, 1.0f), 10.0f, get_current_theme().selected_color, rounded_rectangle_shader),
- placeholder(placeholder_text, *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(16 * get_ui_scale())),
+ placeholder(placeholder_text, *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(16 * get_ui_scale() * get_font_scale())),
mouse_left_inside(false)
{
text.setEditable(true);