mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-14 19:59:59 +01:00
BugFix Allow larger font size and UI scale
This commit is contained in:
@@ -896,7 +896,7 @@ int RenderingWindow::pixelsforRealHeight(float milimeters)
|
|||||||
if (mm_h > 0)
|
if (mm_h > 0)
|
||||||
pixels *= static_cast<float>(glfwGetVideoMode(mo)->height) / static_cast<float>(mm_h);
|
pixels *= static_cast<float>(glfwGetVideoMode(mo)->height) / static_cast<float>(mm_h);
|
||||||
else
|
else
|
||||||
pixels *= 5; // something reasonnable if monitor's physical size is unknown
|
pixels *= 8; // something reasonnable if monitor's physical size is unknown
|
||||||
|
|
||||||
return static_cast<int>( round(pixels) );
|
return static_cast<int>( round(pixels) );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,7 +164,8 @@ bool UserInterface::Init()
|
|||||||
|
|
||||||
// Estalish the base size from the resolution of the monitor
|
// Estalish the base size from the resolution of the monitor
|
||||||
float base_font_size = float(Rendering::manager().mainWindow().pixelsforRealHeight(4.f)) ;
|
float base_font_size = float(Rendering::manager().mainWindow().pixelsforRealHeight(4.f)) ;
|
||||||
base_font_size = CLAMP( base_font_size, 8.f, 50.f);
|
// at least 8 pixels font size
|
||||||
|
base_font_size = MAX(base_font_size, 8.f);
|
||||||
// Load Fonts (using resource manager, NB: a temporary copy of the raw data is necessary)
|
// Load Fonts (using resource manager, NB: a temporary copy of the raw data is necessary)
|
||||||
ImGuiToolkit::SetFont(ImGuiToolkit::FONT_DEFAULT, "Roboto-Regular", int(base_font_size) );
|
ImGuiToolkit::SetFont(ImGuiToolkit::FONT_DEFAULT, "Roboto-Regular", int(base_font_size) );
|
||||||
ImGuiToolkit::SetFont(ImGuiToolkit::FONT_BOLD, "Roboto-Bold", int(base_font_size) + 1 );
|
ImGuiToolkit::SetFont(ImGuiToolkit::FONT_BOLD, "Roboto-Bold", int(base_font_size) + 1 );
|
||||||
@@ -5381,7 +5382,7 @@ void Navigator::RenderMainPannelSettings()
|
|||||||
ImGui::SetCursorPosX(width_);
|
ImGui::SetCursorPosX(width_);
|
||||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||||
if ( ImGui::InputFloat("##Scale", &Settings::application.scale, 0.1f, 0.1f, "%.1f")) {
|
if ( ImGui::InputFloat("##Scale", &Settings::application.scale, 0.1f, 0.1f, "%.1f")) {
|
||||||
Settings::application.scale = CLAMP(Settings::application.scale, 0.5f, 2.f);
|
Settings::application.scale = CLAMP(Settings::application.scale, 0.5f, 5.f);
|
||||||
ImGui::GetIO().FontGlobalScale = Settings::application.scale;
|
ImGui::GetIO().FontGlobalScale = Settings::application.scale;
|
||||||
}
|
}
|
||||||
ImGui::SameLine(0, IMGUI_SAME_LINE);
|
ImGui::SameLine(0, IMGUI_SAME_LINE);
|
||||||
|
|||||||
Reference in New Issue
Block a user