MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / commit_data

Method commit_data

src/DrawingProgram/Tools/BrushTool.cpp:78–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78void 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
100void BrushTool::input_mouse_motion_callback(const InputManager::MouseMotionCallbackArgs& motion) {
101 if(objInfoBeingEdited) {

Callers

nothing calls this directly

Calls 7

brush_stroke_to_skpathFunction · 0.85
commit_updateMethod · 0.80
send_transforms_forMethod · 0.80
send_comp_updateMethod · 0.80
simplify_pathsMethod · 0.45

Tested by

no test coverage detected