aboutsummaryrefslogtreecommitdiff
path: root/src/ImageViewer.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-09-11 11:55:37 +0200
committerdec05eba <dec05eba@protonmail.com>2023-09-11 11:55:37 +0200
commit3b541a9a4c0423178d68a1c34ab85efa9d97fc3b (patch)
tree425c3ea453af1efb970efcbf2ddcace4227a0a42 /src/ImageViewer.cpp
parented2e118344aa38c5fbe17fc91e9cc41d47bce9ab (diff)
Add font specific scale config
Diffstat (limited to 'src/ImageViewer.cpp')
-rw-r--r--src/ImageViewer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ImageViewer.cpp b/src/ImageViewer.cpp
index e8bc71d..fb9912c 100644
--- a/src/ImageViewer.cpp
+++ b/src/ImageViewer.cpp
@@ -14,7 +14,7 @@
#include <cmath>
namespace QuickMedia {
- static const int page_text_character_size = 14 * get_config().scale * get_config().font_scale;
+ static const int page_text_character_size = 14 * get_config().scale * get_config().font_scale * get_config().font.scale.latin;
static mgl::vec2d get_no_image_size_scaled(mgl::vec2d window_size, bool fit_image_to_window) {
mgl::vec2d no_image_page_size(720.0, 1280.0);
@@ -108,7 +108,7 @@ namespace QuickMedia {
if(page == -1 || page == num_pages) {
// TODO: Dont show if first/last chapter
- mgl::Text text(page == -1 ? "Scroll up to go to the previous chapter" : "Scroll down to go to the next chapter", *FontLoader::get_font(FontLoader::FontType::LATIN, 30 * get_config().scale * get_config().font_scale));
+ mgl::Text text(page == -1 ? "Scroll up to go to the previous chapter" : "Scroll down to go to the next chapter", *FontLoader::get_font(FontLoader::FontType::LATIN, 30 * get_config().scale * get_config().font_scale * get_config().font.scale.latin));
auto text_bounds = text.get_bounds();
text.set_color(get_theme().text_color);
mgl::vec2d render_pos_text(floor(window_size.x * 0.5 - text_bounds.size.x * 0.5), image_size.y * 0.5 - text_bounds.size.y * 0.5 + scroll + offset_y);
@@ -160,7 +160,7 @@ namespace QuickMedia {
msg = "Failed to load image for page " + page_str;
}
- mgl::Text error_message(std::move(msg), *FontLoader::get_font(FontLoader::FontType::LATIN, 30 * get_config().scale * get_config().font_scale));
+ mgl::Text error_message(std::move(msg), *FontLoader::get_font(FontLoader::FontType::LATIN, 30 * get_config().scale * get_config().font_scale * get_config().font.scale.latin));
auto text_bounds = error_message.get_bounds();
error_message.set_color(get_theme().text_color);
mgl::vec2d render_pos_text(floor(window_size.x * 0.5 - text_bounds.size.x * 0.5), image_size.y * 0.5 - text_bounds.size.y * 0.5 + scroll + offset_y);
@@ -179,7 +179,7 @@ namespace QuickMedia {
} else {
std::string page_str = std::to_string(1 + page);
- mgl::Text error_message("Downloading page " + page_str, *FontLoader::get_font(FontLoader::FontType::LATIN, 30 * get_config().scale * get_config().font_scale));
+ mgl::Text error_message("Downloading page " + page_str, *FontLoader::get_font(FontLoader::FontType::LATIN, 30 * get_config().scale * get_config().font_scale * get_config().font.scale.latin));
auto text_bounds = error_message.get_bounds();
error_message.set_color(get_theme().text_color);
mgl::vec2d render_pos_text(floor(window_size.x * 0.5 - text_bounds.size.x * 0.5), image_size.y * 0.5 - text_bounds.size.y * 0.5 + scroll + offset_y);