Selection cache is also updated when objects are updated

This commit is contained in:
Yousef Khadadeh 2025-07-31 19:28:18 +03:00
parent 069fc66565
commit 0b1cc8d4c2
8 changed files with 37 additions and 8 deletions

View file

@ -108,20 +108,20 @@ bool DrawComponent::check_timers(DrawingProgram& drawP, const std::shared_ptr<Dr
void DrawComponent::commit_update(DrawingProgram& drawP, bool invalidateCache) {
auto lockedCollabInfo = collabListInfo.lock();
if(invalidateCache && lockedCollabInfo && worldAABB)
drawP.compCache.preupdate_component(lockedCollabInfo, worldAABB);
drawP.preupdate_component(lockedCollabInfo);
initialize_draw_data(drawP);
calculate_world_bounds();
if(invalidateCache && lockedCollabInfo && worldAABB)
drawP.compCache.preupdate_component(lockedCollabInfo, worldAABB);
drawP.preupdate_component(lockedCollabInfo);
}
void DrawComponent::commit_transform(DrawingProgram& drawP, bool invalidateCache) {
auto lockedCollabInfo = collabListInfo.lock();
if(invalidateCache && lockedCollabInfo && worldAABB)
drawP.compCache.preupdate_component(lockedCollabInfo, worldAABB);
drawP.preupdate_component(lockedCollabInfo);
calculate_world_bounds();
if(invalidateCache && lockedCollabInfo && worldAABB)
drawP.compCache.preupdate_component(lockedCollabInfo, worldAABB);
drawP.preupdate_component(lockedCollabInfo);
}
void DrawComponent::client_send_place_many(DrawingProgram& drawP, std::vector<CollabListType::ObjectInfoPtr>& comps) {

View file

@ -71,7 +71,7 @@ void DrawImage::update(DrawingProgram& drawP) {
std::shared_ptr<ResourceDisplay> display = drawP.world.drawData.rMan->get_display_data(d.imageID);
if(display) {
if(display->update_draw() && collabListInfo.lock())
drawP.compCache.invalidate_cache_at_optional_aabb_before_pos(worldAABB, collabListInfo.lock()->pos);
drawP.invalidate_cache_at_component(collabListInfo.lock());
}
}