Fixed cache not updating when canvas color updated

This commit is contained in:
Yousef Khadadeh 2025-08-18 08:16:29 +03:00
parent 1e30e3596d
commit 32c9329e4f
3 changed files with 11 additions and 2 deletions

View file

@ -54,8 +54,7 @@ DrawingProgram::DrawingProgram(World& initWorld):
components.clientInsertCallback(c);
};
components.clientServerFirstPosShiftCallback = [&](uint64_t firstShiftPos) {
compCache.clear_own_cached_surfaces();
selection.clear_own_cached_surfaces();
clear_draw_cache();
};
}
@ -171,6 +170,11 @@ std::unordered_set<ServerClientID> DrawingProgram::get_used_resources() {
return toRet;
}
void DrawingProgram::clear_draw_cache() {
compCache.clear_own_cached_surfaces();
selection.clear_own_cached_surfaces();
}
void DrawingProgram::toolbar_gui() {
Toolbar& t = world.main.toolbar;
CLAY({