Fixed integer division by zero error when loading files

This commit is contained in:
Yousef Khadadeh 2026-04-03 14:18:04 +03:00
parent 58fb02f449
commit 97d308268d
19 changed files with 97 additions and 30 deletions

View file

@ -110,7 +110,12 @@ void LineDrawTool::commit() {
NetworkingObjects::NetObjOwnerPtr<CanvasComponentContainer>& containerPtr = objInfoBeingEdited->obj;
containerPtr->commit_update(drawP);
containerPtr->send_comp_update(drawP, true);
drawP.layerMan.add_undo_place_component(objInfoBeingEdited);
if(containerPtr->get_world_bounds().has_value())
drawP.layerMan.add_undo_place_component(objInfoBeingEdited);
else {
auto& components = containerPtr->parentLayer->get_layer().components;
components->erase(components, containerPtr->objInfo);
}
objInfoBeingEdited = nullptr;
}
}