mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-03 22:30:38 +08:00
SPE-2587: Hotfix of slow loading of binary gcodes in gcodeviewer:
caused by calling render way too often directly from the update function the fix is nothing nice, but it will have to do for now
This commit is contained in:
parent
2229fc1954
commit
c7d9e55808
@ -4331,7 +4331,13 @@ void Plater::load_gcode(const wxString& filename)
|
||||
p->notification_manager->push_download_progress_notification("Loading...", []() { return false; });
|
||||
processor.process_file(filename.ToUTF8().data(), [this](float value) {
|
||||
p->notification_manager->set_download_progress_percentage(value);
|
||||
p->get_current_canvas3D()->render();
|
||||
static auto clock = std::chrono::steady_clock();
|
||||
static auto old_t = clock.now();
|
||||
auto t = clock.now();
|
||||
if (std::chrono::duration_cast<std::chrono::milliseconds>(t - old_t).count() > 200) {
|
||||
p->get_current_canvas3D()->render();
|
||||
old_t = t;
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
|
Loading…
x
Reference in New Issue
Block a user