mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-10 23:01:51 +08:00
Extend advance height when font is collection
This commit is contained in:
parent
2886d26fa0
commit
bf55f63c39
@ -735,6 +735,10 @@ void GLGizmoEmboss::initialize()
|
|||||||
ImVec2(cfg.minimal_window_size.x,
|
ImVec2(cfg.minimal_window_size.x,
|
||||||
cfg.minimal_window_size.y + advance_height);
|
cfg.minimal_window_size.y + advance_height);
|
||||||
|
|
||||||
|
cfg.minimal_window_size_with_collections =
|
||||||
|
ImVec2(cfg.minimal_window_size_with_advance.x,
|
||||||
|
cfg.minimal_window_size_with_advance.y + input_height);
|
||||||
|
|
||||||
int max_style_image_width = cfg.max_style_name_width /2 -
|
int max_style_image_width = cfg.max_style_name_width /2 -
|
||||||
2 * style.FramePadding.x;
|
2 * style.FramePadding.x;
|
||||||
int max_style_image_height = 1.5 * input_height;
|
int max_style_image_height = 1.5 * input_height;
|
||||||
@ -2811,9 +2815,9 @@ void GLGizmoEmboss::set_minimal_window_size(bool is_advance_edit_style)
|
|||||||
|
|
||||||
const ImVec2 &GLGizmoEmboss::get_minimal_window_size() const
|
const ImVec2 &GLGizmoEmboss::get_minimal_window_size() const
|
||||||
{
|
{
|
||||||
return m_is_advanced_edit_style ?
|
return (!m_is_advanced_edit_style) ? m_gui_cfg->minimal_window_size :
|
||||||
m_gui_cfg->minimal_window_size_with_advance :
|
((!m_style_manager.has_collections())? m_gui_cfg->minimal_window_size_with_advance :
|
||||||
m_gui_cfg->minimal_window_size;
|
m_gui_cfg->minimal_window_size_with_collections);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ALLOW_ADD_FONT_BY_OS_SELECTOR
|
#ifdef ALLOW_ADD_FONT_BY_OS_SELECTOR
|
||||||
|
@ -178,6 +178,7 @@ private:
|
|||||||
// Zero means it is calculated in init function
|
// Zero means it is calculated in init function
|
||||||
ImVec2 minimal_window_size = ImVec2(0, 0);
|
ImVec2 minimal_window_size = ImVec2(0, 0);
|
||||||
ImVec2 minimal_window_size_with_advance = ImVec2(0, 0);
|
ImVec2 minimal_window_size_with_advance = ImVec2(0, 0);
|
||||||
|
ImVec2 minimal_window_size_with_collections = ImVec2(0, 0);
|
||||||
float input_width = 0.f;
|
float input_width = 0.f;
|
||||||
float delete_pos_x = 0.f;
|
float delete_pos_x = 0.f;
|
||||||
float max_style_name_width = 0.f;
|
float max_style_name_width = 0.f;
|
||||||
|
@ -112,6 +112,8 @@ public:
|
|||||||
const std::optional<wxFont> &get_wx_font() const { return m_style_cache.wx_font; }
|
const std::optional<wxFont> &get_wx_font() const { return m_style_cache.wx_font; }
|
||||||
const std::optional<wxFont> &get_stored_wx_font() const { return m_style_cache.stored_wx_font; }
|
const std::optional<wxFont> &get_stored_wx_font() const { return m_style_cache.stored_wx_font; }
|
||||||
Emboss::FontFileWithCache &get_font_file_with_cache() { return m_style_cache.font_file; }
|
Emboss::FontFileWithCache &get_font_file_with_cache() { return m_style_cache.font_file; }
|
||||||
|
bool has_collections() const { return m_style_cache.font_file.font_file != nullptr &&
|
||||||
|
m_style_cache.font_file.font_file->infos.size() > 1; }
|
||||||
|
|
||||||
// True when activ style has same name as some of stored style
|
// True when activ style has same name as some of stored style
|
||||||
bool exist_stored_style() const { return m_style_cache.style_index != std::numeric_limits<size_t>::max(); }
|
bool exist_stored_style() const { return m_style_cache.style_index != std::numeric_limits<size_t>::max(); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user