Improve performance for all tools

This commit is contained in:
Yousef Khadadeh 2026-05-18 18:35:40 +03:00
parent 0a474c16a0
commit 22e04b0ca5
17 changed files with 76 additions and 38 deletions

View file

@ -225,8 +225,8 @@ void BrushTool::tool_update() {
if(commitUpdate && objInfoBeingEdited) {
NetworkingObjects::NetObjOwnerPtr<CanvasComponentContainer>& containerPtr = objInfoBeingEdited->obj;
containerPtr->send_comp_update(drawP, false);
containerPtr->commit_update(drawP);
containerPtr->send_comp_update(drawP, false);
commitUpdate = false;
}
}
@ -237,6 +237,7 @@ void BrushTool::commit_stroke() {
fix_tip();
containerPtr->commit_update(drawP);
containerPtr->send_comp_update(drawP, true);
commitUpdate = false;
if(containerPtr->get_world_bounds().has_value())
drawP.layerMan.add_undo_place_component(objInfoBeingEdited);
else {
@ -244,7 +245,6 @@ void BrushTool::commit_stroke() {
components->erase(components, containerPtr->objInfo);
}
objInfoBeingEdited = nullptr;
commitUpdate = false;
}
}