Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32ea4ffd authored by Gilles Debunne's avatar Gilles Debunne
Browse files

Fix for ellipsized text that has two lines at maximum.

The breakOnlyAtSpaces test did not include the reset at the end of the loop
which resets j and w (current position and width). As a result, the second line
was too long from the start and never cut again.

Hours a debug, a simple { change.

Bug 2969667

Change-Id: I1e5b4a37cd9e64d115e6343d7788db3a6ef881e0
parent 7dd7c69f
Loading
Loading
Loading
Loading
+92 −90
Original line number Diff line number Diff line
@@ -361,7 +361,8 @@ public class StaticLayout extends Layout
                            if (fitbottom > okbottom)
                                okbottom = fitbottom;
                        }
                    } else if (breakOnlyAtSpaces) {
                    } else {
                        if (breakOnlyAtSpaces) {
                            if (ok != here) {
                                // Log.e("text", "output ok " + here + " to " +ok);

@@ -457,6 +458,7 @@ public class StaticLayout extends Layout

                                here = here + 1;
                            }
                        }

                        if (here < spanStart) {
                            // didn't output all the text for this span