mirror of https://github.com/axmolengine/axmol.git
Checking condition for dirty ImGui device objects [skip appveyor][skip travis]
This commit is contained in:
parent
7a15d5b74f
commit
a824eb4050
|
@ -234,9 +234,8 @@ void ImGuiEXT::addFont(const std::string& fontFile, float fontSize, CHS_GLYPH_RA
|
||||||
{
|
{
|
||||||
if (FileUtils::getInstance()->isFileExistInternal(fontFile)) {
|
if (FileUtils::getInstance()->isFileExistInternal(fontFile)) {
|
||||||
_fontsInfoMap.emplace(fontFile, FontInfo{ fontSize, glyphRange });
|
_fontsInfoMap.emplace(fontFile, FontInfo{ fontSize, glyphRange });
|
||||||
|
ImGui_ImplCocos2dx_SetDeviceObjectsDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui_ImplCocos2dx_SetDeviceObjectsDirty();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImGuiEXT::removeFont(const std::string& fontFile)
|
void ImGuiEXT::removeFont(const std::string& fontFile)
|
||||||
|
@ -249,8 +248,10 @@ void ImGuiEXT::removeFont(const std::string& fontFile)
|
||||||
|
|
||||||
void ImGuiEXT::clearFonts()
|
void ImGuiEXT::clearFonts()
|
||||||
{
|
{
|
||||||
|
bool haveCustomFonts = !_fontsInfoMap.empty();
|
||||||
_fontsInfoMap.clear();
|
_fontsInfoMap.clear();
|
||||||
ImGui_ImplCocos2dx_SetDeviceObjectsDirty();
|
if(haveCustomFonts)
|
||||||
|
ImGui_ImplCocos2dx_SetDeviceObjectsDirty();
|
||||||
|
|
||||||
// auto drawData = ImGui::GetDrawData();
|
// auto drawData = ImGui::GetDrawData();
|
||||||
// if(drawData) drawData->Clear();
|
// if(drawData) drawData->Clear();
|
||||||
|
|
Loading…
Reference in New Issue