From 1de2ff02bb746607727900180b6f32ded0cd7856 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 23 Nov 2022 18:54:18 +0100 Subject: Allow opening 4chan post directly --- src/Text.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Text.cpp') diff --git a/src/Text.cpp b/src/Text.cpp index 28247e6..74a0625 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -770,7 +770,7 @@ namespace QuickMedia const float latin_font_width = latin_font->get_glyph(' ').advance; const float vspace = font_get_real_height(latin_font); const float hspace_latin = latin_font_width + characterSpacing; - const float emoji_spacing = 2.0f; + const float emoji_spacing = std::max(1, int(vspace / 10.0f)); int hspace_monospace = 0; const mgl::Color url_color = get_theme().url_text_color; @@ -814,7 +814,7 @@ namespace QuickMedia int vertexStart = vertices[vertices_index].size(); if(prevCodePoint != 0) - glyphPos.x += emoji_spacing; + glyphPos.x += emoji_spacing + characterSpacing; const float font_height_offset = vspace; mgl::vec2f vertexTopLeft(glyphPos.x, glyphPos.y + font_height_offset - textElement.size.y); @@ -854,7 +854,7 @@ namespace QuickMedia const mgl::vec2f emoji_size = { vspace, vspace }; if(prevCodePoint != 0) - glyphPos.x += emoji_spacing; + glyphPos.x += emoji_spacing + characterSpacing; const float font_height_offset = floor(vspace * 0.5f); mgl::vec2f vertexTopLeft(glyphPos.x, glyphPos.y + font_height_offset - emoji_size.y * 0.5f); -- cgit v1.2.3