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

Method set_text_direction_between

src/RichText/TextBox.cpp:678–690  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

676}
677
678void TextBox::set_text_direction_between(size_t paragraphIndex1, size_t paragraphIndex2, skia::textlayout::TextDirection newDirection) {
679 auto [start, end] = get_start_end_paragraph_pos(paragraphIndex1, paragraphIndex2);
680 bool anythingChanged = false;
681 for(size_t i = start; i <= end; i++) {
682 if(paragraphs[i].pStyleData.textDirection != newDirection) {
683 anythingChanged = true;
684 paragraphs[i].pStyleData.textDirection = newDirection;
685 }
686 }
687 if(anythingChanged) {
688 needsRebuild = true;
689 }
690}
691
692ParagraphStyleData TextBox::get_paragraph_style_data_at(size_t paragraphIndex) {
693 return paragraphs[std::min(paragraphIndex, paragraphs.size() - 1)].pStyleData;

Callers 2

edit_guiMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected