Fix timetable window being cut off on large font sizes

This commit is contained in:
jakubg1
2024-07-03 22:55:43 +02:00
parent fb3c0c2d6d
commit 27efcdccfa

View File

@@ -485,11 +485,13 @@ timetable_panel::render() {
| ImGuiWindowFlags_NoCollapse
| ( size.x > 0 ? ImGuiWindowFlags_NoResize : 0 );
// HACK: Make sure the timetable window is of correct width when using a larger font size.
float horizontalScale = Global.ui_fontsize / 13;
if( size.x > 0 ) {
ImGui::SetNextWindowSize( ImVec2S( size.x, size.y ) );
ImGui::SetNextWindowSize( ImVec2S( size.x * horizontalScale, size.y ) );
}
if( size_min.x > 0 ) {
ImGui::SetNextWindowSizeConstraints( ImVec2S( size_min.x, size_min.y ), ImVec2S( size_max.x, size_max.y ) );
ImGui::SetNextWindowSizeConstraints( ImVec2S( size_min.x * horizontalScale, size_min.y ), ImVec2S( size_max.x * horizontalScale, size_max.y ) );
}
auto const panelname { (
title.empty() ?