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

Method commit_data

src/DrawingProgram/Tools/LineDrawTool.cpp:51–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void LineDrawTool::commit_data(bool final) {
52 if(objInfoBeingEdited) {
53 NetworkingObjects::NetObjOwnerPtr<CanvasComponentContainer>& containerPtr = objInfoBeingEdited->obj;
54 MeshCanvasComponent& newMesh = static_cast<MeshCanvasComponent&>(containerPtr->get_comp());
55 newMesh.d.meshPath = BrushComponentCode::brush_stroke_to_skpath(brushPoints, drawP.world.main.toolConfig.lineDraw.hasRoundCaps);
56 if(final) {
57 containerPtr->get_comp().simplify_paths();
58 containerPtr->normalize_object_coordinates();
59 }
60 containerPtr->commit_update(drawP);
61 if(final) {
62 drawP.world.send_reliable_multi_command_to_all([&]() {
63 drawP.send_transforms_for({objInfoBeingEdited});
64 containerPtr->send_comp_update(drawP, final);
65 });
66 }
67 else
68 containerPtr->send_comp_update(drawP, final);
69 }
70 commitUpdate = false;
71}
72
73void LineDrawTool::gui_phone_toolbox(PhoneDrawingProgramScreen& t) {
74 using namespace GUIStuff;

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