Deliberately setting the SLA dialog a bit too large
It is not possible to precisely calculate actual window size before the rendering, so I added a safety margin. It would be nicer to let the window autoscale and only use the inflated dimension for possible moving the window upward to prevent collision with the bottom panel, but... ImGui autoscaling does not work properly for some reason (the window size autoscales only after a mouse move), so this is a workaround.
This commit is contained in:
parent
32af3ff3c0
commit
2269e1b183
1 changed files with 2 additions and 2 deletions
|
@ -565,12 +565,12 @@ void GLGizmoSlaSupports::on_render_input_window(float x, float y, float bottom_l
|
||||||
RENDER_AGAIN:
|
RENDER_AGAIN:
|
||||||
m_imgui->set_next_window_pos(x, y, ImGuiCond_Always);
|
m_imgui->set_next_window_pos(x, y, ImGuiCond_Always);
|
||||||
|
|
||||||
const ImVec2 window_size(m_imgui->scaled(15.f, 16.5f));
|
const ImVec2 window_size(m_imgui->scaled(17.f, 18.f));
|
||||||
ImGui::SetNextWindowPos(ImVec2(x, y - std::max(0.f, y+window_size.y-bottom_limit) ));
|
ImGui::SetNextWindowPos(ImVec2(x, y - std::max(0.f, y+window_size.y-bottom_limit) ));
|
||||||
ImGui::SetNextWindowSize(ImVec2(window_size));
|
ImGui::SetNextWindowSize(ImVec2(window_size));
|
||||||
|
|
||||||
m_imgui->set_next_window_bg_alpha(0.5f);
|
m_imgui->set_next_window_bg_alpha(0.5f);
|
||||||
m_imgui->begin(on_get_name(), ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse);
|
m_imgui->begin(on_get_name(), ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse);
|
||||||
|
|
||||||
ImGui::PushItemWidth(100.0f);
|
ImGui::PushItemWidth(100.0f);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue