Read the system CJK font once, and hold fonts as ImFont pointers
Each of the four fonts merged the system CJK font from a fresh read of its file, twice, and never freed it. It is now read once and shared. Startup memory with a document open went from 412 MB to 269 MB.
This commit is contained in:
1 parent
2f1e75da37
commit
20209e655e
12 files changed
+58
-106
No files matched your search
@@ -402,7 +402,7 @@ void SpritesheetEditor::update(Manager& manager, Settings& settings, Resources&
|
||||
if (tool == TOOL_PAN && hoveredRegionId != -1 && spritesheet)
|
||||
if (auto region = region_get(hoveredRegionId); region && ImGui::BeginTooltip())
|
||||
{
|
||||
ImGui::PushFont(resources.fonts[FONT_BOLD].get(), FONT_SIZE);
|
||||
ImGui::PushFont(resources.fonts[FONT_BOLD], FONT_SIZE);
|
||||
ImGui::TextUnformatted(region->name.c_str());
|
||||
ImGui::PopFont();
|
||||
auto originLabel = localize.get(region->origin == Origin::TOP_LEFT ? LABEL_REGION_ORIGIN_TOP_LEFT
|
||||
|
||||
Reference in new issue
Block a user