| 76 | } |
| 77 | |
| 78 | void BrushTool::commit_data(bool final) { |
| 79 | if(objInfoBeingEdited) { |
| 80 | NetworkingObjects::NetObjOwnerPtr<CanvasComponentContainer>& containerPtr = objInfoBeingEdited->obj; |
| 81 | MeshCanvasComponent& newMesh = static_cast<MeshCanvasComponent&>(containerPtr->get_comp()); |
| 82 | newMesh.d.meshPath = BrushComponentCode::brush_stroke_to_skpath(genData.brushPoints, drawP.world.main.toolConfig.brush.hasRoundCaps); |
| 83 | if(final) { |
| 84 | containerPtr->get_comp().simplify_paths(); |
| 85 | containerPtr->normalize_object_coordinates(); |
| 86 | } |
| 87 | containerPtr->commit_update(drawP); |
| 88 | if(final) { |
| 89 | drawP.world.send_reliable_multi_command_to_all([&]() { |
| 90 | drawP.send_transforms_for({objInfoBeingEdited}); |
| 91 | containerPtr->send_comp_update(drawP, true); |
| 92 | }); |
| 93 | } |
| 94 | else |
| 95 | containerPtr->send_comp_update(drawP, final); |
| 96 | } |
| 97 | commitUpdate = false; |
| 98 | } |
| 99 | |
| 100 | void BrushTool::input_mouse_motion_callback(const InputManager::MouseMotionCallbackArgs& motion) { |
| 101 | if(objInfoBeingEdited) { |
nothing calls this directly
no test coverage detected