mirror of https://github.com/WerWolv/ImHex.git
fix: Don't delete font atlas after passing it to ImGui
This commit is contained in:
parent
b94a4288bf
commit
6fd594c1f4
|
@ -152,8 +152,11 @@ namespace hex::fonts {
|
||||||
return m_fontAtlas->Build();
|
return m_fontAtlas->Build();
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] ImFontAtlas* getAtlas() const {
|
[[nodiscard]] ImFontAtlas* takeAtlas() {
|
||||||
return m_fontAtlas;
|
auto result = m_fontAtlas;
|
||||||
|
m_fontAtlas = nullptr;
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
float calculateFontDescend(const ImHexApi::Fonts::Font &font, float fontSize) const {
|
float calculateFontDescend(const ImHexApi::Fonts::Font &font, float fontSize) const {
|
||||||
|
@ -331,7 +334,7 @@ namespace hex::fonts {
|
||||||
const bool result = fontAtlas.build();
|
const bool result = fontAtlas.build();
|
||||||
if (result) {
|
if (result) {
|
||||||
// Set the font atlas if the build was successful
|
// Set the font atlas if the build was successful
|
||||||
ImHexApi::Fonts::impl::setFontAtlas(fontAtlas.getAtlas());
|
ImHexApi::Fonts::impl::setFontAtlas(fontAtlas.takeAtlas());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue