fix log thread bug, add clean memory button, fix pinch zoom bug, set android back button to undo

This commit is contained in:
2017-05-12 13:31:56 +01:00
parent 6dbb8bf3a1
commit 51e355d039
13 changed files with 72 additions and 17 deletions

View File

@@ -636,6 +636,12 @@ void App::initLayout()
ActionManager::undo();
};
}
if (auto* button = layout[main_id]->find<NodeButtonCustom>("btn-clean-memory"))
{
button->on_click = [this](Node*) {
ActionManager::clear();
};
}
if (auto* button = layout[main_id]->find<NodeButton>("btn-clear"))
{
button->on_click = [this](Node*) {
@@ -961,7 +967,7 @@ void App::update_memory_usage(size_t bytes)
if (auto txt = layout[main_id]->find<NodeText>("txt-memory"))
{
static char buffer[128];
sprintf(buffer, "History memory: %.2f Kb", bytes / 1024.f);
sprintf(buffer, "History memory: %.2f Mb", bytes / 1024.f / 1024.f);
txt->set_text(buffer);
layout[main_id]->update();
}