FIX:fix keypad ICONS not being centered

Change-Id: I2b20a2f9b95a1970802b51c7dc51d96ece91fce6
(cherry picked from commit bf348670711467f9092f29ddccc8d5eb03dcc18e)
This commit is contained in:
xiangdong.yang 2022-07-25 09:50:52 +08:00 committed by Lane.Wei
parent a713573544
commit a0e2e1e62d
4 changed files with 15 additions and 3 deletions

View file

@ -395,7 +395,10 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(6.0f, 10.0f)); ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(6.0f, 10.0f));
float get_cur_y = ImGui::GetContentRegionMax().y + ImGui::GetFrameHeight() + y; float get_cur_y = ImGui::GetContentRegionMax().y + ImGui::GetFrameHeight() + y;
show_tooltip_information(caption_max, x, get_cur_y); show_tooltip_information(caption_max, x, get_cur_y);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(6.0f, 5.0f));
float f_scale =m_parent.get_gizmos_manager().get_layout_scale();
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(6.0f, 4.0f * f_scale));
ImGui::SameLine(); ImGui::SameLine();
// Perform button is for gap fill // Perform button is for gap fill

View file

@ -601,10 +601,12 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott
ImGui::Separator(); ImGui::Separator();
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(6.0f, 10.0f)); ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(6.0f, 10.0f));
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(6.0f, 5.0f));
float get_cur_y = ImGui::GetContentRegionMax().y + ImGui::GetFrameHeight() + y; float get_cur_y = ImGui::GetContentRegionMax().y + ImGui::GetFrameHeight() + y;
show_tooltip_information(caption_max, x, get_cur_y); show_tooltip_information(caption_max, x, get_cur_y);
float f_scale =m_parent.get_gizmos_manager().get_layout_scale();
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(6.0f, 4.0f * f_scale));
ImGui::SameLine(); ImGui::SameLine();
if (m_current_tool == ImGui::GapFillIcon) { if (m_current_tool == ImGui::GapFillIcon) {

View file

@ -199,6 +199,11 @@ bool GLGizmosManager::init_icon_textures()
return true; return true;
} }
float GLGizmosManager::get_layout_scale()
{
return m_layout.scale;
}
bool GLGizmosManager::init_arrow(const BackgroundTexture::Metadata& arrow_texture) bool GLGizmosManager::init_arrow(const BackgroundTexture::Metadata& arrow_texture)
{ {
if (m_arrow_texture.texture.get_id() != 0) if (m_arrow_texture.texture.get_id() != 0)

View file

@ -159,6 +159,8 @@ public:
bool init_icon_textures(); bool init_icon_textures();
float get_layout_scale();
bool init_arrow(const BackgroundTexture::Metadata& arrow_texture); bool init_arrow(const BackgroundTexture::Metadata& arrow_texture);
template<class Archive> template<class Archive>