diff options
author | Raph Levien <raph@google.com> | 2015-04-14 18:29:39 -0700 |
---|---|---|
committer | Raph Levien <raph@google.com> | 2015-04-15 19:12:41 -0700 |
commit | dc7bc6e39e1ef6b713b927baf24db8b4f02f1a3f (patch) | |
tree | 019e56fbd9674cae60e20493cc0303bb08995376 /libs | |
parent | 5cdad92c300a65cab89b172e952186f0c5870657 (diff) | |
download | android_frameworks_minikin-dc7bc6e39e1ef6b713b927baf24db8b4f02f1a3f.tar.gz android_frameworks_minikin-dc7bc6e39e1ef6b713b927baf24db8b4f02f1a3f.tar.bz2 android_frameworks_minikin-dc7bc6e39e1ef6b713b927baf24db8b4f02f1a3f.zip |
Add margins array to line widths object
In order to support layout in non-rectangular regions, the LineWidths
object needs to accept an arbitrary array of margins. This is
implemented in addition to the existing firstWidthLineCount/restWidth
mechanism for convenience, though using only arrays would have the
same expressive power.
Bug: 20182243
Change-Id: Iea96bca1a92012314ac27e617c67f306c1f1b2f2
Diffstat (limited to 'libs')
-rw-r--r-- | libs/minikin/LineBreaker.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/minikin/LineBreaker.cpp b/libs/minikin/LineBreaker.cpp index f7f3fb3..9298f77 100644 --- a/libs/minikin/LineBreaker.cpp +++ b/libs/minikin/LineBreaker.cpp @@ -78,6 +78,11 @@ void LineBreaker::setLineWidths(float firstWidth, int firstWidthLineCount, float mLineWidths.setWidths(firstWidth, firstWidthLineCount, restWidth); } + +void LineBreaker::setMargins(const std::vector<float>& margins) { + mLineWidths.setMargins(margins); +} + // This function determines whether a character is a space that disappears at end of line. // It is the Unicode set: [[:General_Category=Space_Separator:]-[:Line_Break=Glue:]] // Note: all such characters are in the BMP, so it's ok to use code units for this. |