Fix windows build

This commit is contained in:
Georg Hagen
2025-11-25 22:33:14 +01:00
parent dbb46f70d5
commit 2164d83711

View File

@@ -29,7 +29,12 @@ namespace OpenVulkano::Scene::UI
return; return;
} }
ImFontConfig conf; ImFontConfig conf;
strlcpy(conf.Name, m_name.data(), std::min(m_name.size(), sizeof(conf.Name))); if (m_name.size() >= sizeof(conf.Name))
{
memcpy(conf.Name, m_name.data(), sizeof(conf.Name) - 1);
conf.Name[sizeof(conf.Name) - 1] = '\0';
}
else memcpy(conf.Name, m_name.data(), m_name.size() + 1);
conf.FontDataOwnedByAtlas = false; conf.FontDataOwnedByAtlas = false;
conf.RasterizerDensity = 3; // TODO check window scale factor conf.RasterizerDensity = 3; // TODO check window scale factor
ImGuiIO& io = ImGui::GetIO(); ImGuiIO& io = ImGui::GetIO();