Improve performance when hosting canvas with many objects

This commit is contained in:
Yousef Khadadeh 2025-07-30 11:36:55 +03:00
parent 207e173c1a
commit b2f2070f95
5 changed files with 28 additions and 30 deletions

View file

@ -76,8 +76,7 @@ void DrawingProgram::init_client_callbacks() {
if(!objPtr)
return;
std::shared_ptr<DrawComponent>& comp = objPtr->obj;
float dur = std::chrono::duration_cast<std::chrono::duration<float>>(std::chrono::steady_clock::now() - comp->lastUpdateTime).count();
if(dur > CLIENT_DRAWCOMP_DELAY_TIMER_DURATION){
if((std::chrono::steady_clock::now() - comp->lastUpdateTime) > CLIENT_DRAWCOMP_DELAY_TIMER_DURATION){
comp->delayedUpdatePtr = nullptr;
message(*comp);
if(isTemp)