From e5e885794ad6afa848af54f61ed2e8b21319e730 Mon Sep 17 00:00:00 2001 From: Yousef Khadadeh Date: Tue, 12 Aug 2025 14:37:18 +0300 Subject: [PATCH] Fixed a cache update glitch in eraser tool after erasing is done --- src/DrawingProgram/EraserTool.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/DrawingProgram/EraserTool.cpp b/src/DrawingProgram/EraserTool.cpp index 0059203..d072a49 100644 --- a/src/DrawingProgram/EraserTool.cpp +++ b/src/DrawingProgram/EraserTool.cpp @@ -23,6 +23,10 @@ void EraserTool::switch_tool(DrawingProgramToolType newTool) { if(!erasedComponents.empty()) { DrawingProgramCache::move_components_from_bvh_nodes_to_set(erasedComponents, erasedBVHNodes); drawP.client_erase_set(erasedComponents); + // NOTE: Ideally, you would just recalculate the lastDrawnPos of every cache instead of invalidating and redrawing the caches + // However, the eraser might have other visual glitches during drawing that i am unaware of, so for now, just refresh the + // cache after a draw + drawP.compCache.invalidate_cache_before_pos(0); } erasedComponents.clear(); erasedBVHNodes.clear();