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

Method edit_start

src/DrawingProgram/Tools/EditTools/TextBoxEditTool.cpp:778–800  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

776}
777
778void TextBoxEditTool::edit_start(EditTool& editTool, std::any& prevData) {
779 auto& a = static_cast<TextBoxCanvasComponent&>(comp->obj->get_comp());
780 auto& cur = a.cursor;
781 auto& textbox = a.textBox;
782
783 a.init_text_box(drawP);
784
785 cur = std::make_shared<TextBox::Cursor>();
786 Vector2f textSelectPos = a.get_mouse_pos(drawP);
787 textbox->process_mouse_left_button(*cur, textSelectPos, 1, false, false);
788 prevData = get_all_data(a);
789 a.d.editing = true;
790
791 set_styles_at_selection(a);
792
793 editTool.add_point_handle({&a.d.p1, nullptr, &a.d.p2});
794 editTool.add_point_handle({&a.d.p2, &a.d.p1, nullptr});
795
796 commitUpdate = true;
797
798 userInput = std::make_unique<RichTextUserInput>(CustomEvents::text_box_get_new_id(), textbox, cur, currentModsPtr);
799 CustomEvents::emit_event(CustomEvents::RefreshTextBoxInputEvent{});
800}
801
802void TextBoxEditTool::edit_update() {
803}

Callers

nothing calls this directly

Calls 6

text_box_get_new_idFunction · 0.85
emit_eventFunction · 0.85
init_text_boxMethod · 0.80
add_point_handleMethod · 0.80
get_mouse_posMethod · 0.45

Tested by

no test coverage detected