Set default align to center as mentioned in SPE-1597

Align visualization warning is active only for multiline
This commit is contained in:
Filip Sykala - NTB T15p 2023-08-03 09:12:49 +02:00
parent 071f88de13
commit 6c0d7b79e3
2 changed files with 7 additions and 9 deletions

View File

@ -69,7 +69,7 @@ struct FontProp
using Align = std::pair<HorizontalAlign, VerticalAlign>; using Align = std::pair<HorizontalAlign, VerticalAlign>;
// change pivot of text // change pivot of text
// When not set, center is used and is not stored // When not set, center is used and is not stored
Align align = Align(HorizontalAlign::left, VerticalAlign::top); Align align = Align(HorizontalAlign::center, VerticalAlign::top);
////// //////
// Duplicit data to wxFontDescriptor // Duplicit data to wxFontDescriptor

View File

@ -1657,23 +1657,21 @@ void GLGizmoEmboss::draw_text_input()
warning_tool_tip += t; warning_tool_tip += t;
}; };
if (priv::is_text_empty(m_text)) if (priv::is_text_empty(m_text)) append_warning(_u8L("Embossed text cannot contain only white spaces."));
append_warning(_u8L("Embossed text cannot contain only white spaces.")); if (m_text_contain_unknown_glyph) append_warning(_u8L("Text contains character glyph (represented by '?') unknown by font."));
if (m_text_contain_unknown_glyph)
append_warning(_u8L("Text contains character glyph (represented by '?') unknown by font."));
const FontProp &prop = m_style_manager.get_font_prop(); const FontProp &prop = m_style_manager.get_font_prop();
if (prop.skew.has_value()) append_warning(_u8L("Text input doesn't show font skew.")); if (prop.skew.has_value()) append_warning(_u8L("Text input doesn't show font skew."));
if (prop.boldness.has_value()) append_warning(_u8L("Text input doesn't show font boldness.")); if (prop.boldness.has_value()) append_warning(_u8L("Text input doesn't show font boldness."));
if (prop.line_gap.has_value()) if (prop.line_gap.has_value()) append_warning(_u8L("Text input doesn't show gap between lines."));
append_warning(_u8L("Text input doesn't show gap between lines."));
auto &ff = m_style_manager.get_font_file_with_cache(); auto &ff = m_style_manager.get_font_file_with_cache();
float imgui_size = StyleManager::get_imgui_font_size(prop, *ff.font_file, scale); float imgui_size = StyleManager::get_imgui_font_size(prop, *ff.font_file, scale);
if (imgui_size > StyleManager::max_imgui_font_size) if (imgui_size > StyleManager::max_imgui_font_size)
append_warning(_u8L("Too tall, diminished font height inside text input.")); append_warning(_u8L("Too tall, diminished font height inside text input."));
if (imgui_size < StyleManager::min_imgui_font_size) if (imgui_size < StyleManager::min_imgui_font_size)
append_warning(_u8L("Too small, enlarged font height inside text input.")); append_warning(_u8L("Too small, enlarged font height inside text input."));
if (prop.align.first == FontProp::HorizontalAlign::center || prop.align.first == FontProp::HorizontalAlign::right) bool is_multiline = m_text_lines.get_lines().size() > 1;
if (is_multiline && (prop.align.first == FontProp::HorizontalAlign::center || prop.align.first == FontProp::HorizontalAlign::right))
append_warning(_u8L("Text doesn't show current horizontal alignment.")); append_warning(_u8L("Text doesn't show current horizontal alignment."));
} }