@@ -179,6 +179,17 @@ class ShapedTextOptions
179179 return withMember (*this , &ShapedTextOptions::ellipsis, std::move (x));
180180 }
181181
182+ /* Draw each line in its entirety even if it goes beyond wordWrapWidth. This means that even
183+ if configured, an ellipsis will never be inserted.
184+
185+ This is used by the TextEditor where the Viewport guarantees that all text will be viewable
186+ even beyond the word wrap width.
187+ */
188+ [[nodiscard]] ShapedTextOptions withDrawLinesInFull (bool x = true ) const
189+ {
190+ return withMember (*this , &ShapedTextOptions::drawLinesInFull, std::move (x));
191+ }
192+
182193 [[nodiscard]] ShapedTextOptions withReadingDirection (std::optional<TextDirection> x) const
183194 {
184195 return withMember (*this , &ShapedTextOptions::readingDir, x);
@@ -203,6 +214,7 @@ class ShapedTextOptions
203214 const auto & getTrailingWhitespacesShouldFit () const { return trailingWhitespacesShouldFit; }
204215 const auto & getMaxNumLines () const { return maxNumLines; }
205216 const auto & getEllipsis () const { return ellipsis; }
217+ const auto & getDrawLinesInFull () const { return drawLinesInFull; }
206218 const auto & getAllowBreakingInsideWord () const { return allowBreakingInsideWord; }
207219
208220private:
@@ -227,6 +239,7 @@ class ShapedTextOptions
227239 bool baselineAtZero = false ;
228240 bool allowBreakingInsideWord = false ;
229241 bool trailingWhitespacesShouldFit = true ;
242+ bool drawLinesInFull = false ;
230243 int64 maxNumLines = std::numeric_limits<int64>::max();
231244 String ellipsis;
232245};
0 commit comments