Align font preview to left. (closer to font name)

This commit is contained in:
Filip Sykala - NTB T15p 2024-01-05 11:25:34 +01:00
parent b67c4785f0
commit eb9b8c0c2b
2 changed files with 4 additions and 3 deletions

View File

@ -3705,7 +3705,7 @@ GuiCfg create_gui_configuration()
int max_style_image_height = static_cast<int>(std::round(1.5 * input_height)); int max_style_image_height = static_cast<int>(std::round(1.5 * input_height));
cfg.max_style_image_size = Vec2i(max_style_image_width, max_style_image_height); cfg.max_style_image_size = Vec2i(max_style_image_width, max_style_image_height);
cfg.face_name_size = Vec2i(cfg.input_width, line_height_with_spacing); cfg.face_name_size = Vec2i(cfg.input_width, line_height_with_spacing);
cfg.face_name_texture_offset_x = cfg.face_name_size.x() + space; cfg.face_name_texture_offset_x = cfg.face_name_size.x() + style.WindowPadding.x + space;
return cfg; return cfg;
} }
} // namespace } // namespace

View File

@ -146,8 +146,9 @@ void CreateFontImageJob::finalize(bool canceled, std::exception_ptr &)
glsafe(::glBindTexture(target, m_input.texture_id)); glsafe(::glBindTexture(target, m_input.texture_id));
GLsizei w = m_tex_size.x(), h = m_tex_size.y(); GLsizei w = m_tex_size.x(), h = m_tex_size.y();
GLint xoffset = m_input.size.x() - m_tex_size.x(), // arrange right GLint xoffset = 0; // align to left
yoffset = m_input.size.y() * m_input.index; // GLint xoffset = m_input.size.x() - m_tex_size.x(); // align right
GLint yoffset = m_input.size.y() * m_input.index;
glsafe(::glTexSubImage2D(target, m_input.level, xoffset, yoffset, w, h, glsafe(::glTexSubImage2D(target, m_input.level, xoffset, yoffset, w, h,
m_input.format, m_input.type, m_result.data())); m_input.format, m_input.type, m_result.data()));