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

Skip to content
Commit 431e506b authored by Roozbeh Pournader's avatar Roozbeh Pournader
Browse files

Fix line height problem with inline images in StaticLayout.

Previously, paragraphs with ImageSpans in their middle would continue to
carry the height of the image into the line height of next lines. This was
a regression from L.

The bug was due to StaticLayout's out() method almost always
modifying the value of its parameter "fm", although that was only
intended when there were LineHeightSpans in the text. The method
generate() was assuming that it can restore fmTop etc to metrics of
the current span by setting them from "fm" after out() was run, while
"fm" was modified by out() and its original values was lost!

The fix makes sure to set chooseHt back to null if there were no
LineHeightSpans, so out() would not modify "fm" unless necessary.

AOSP bug: https://code.google.com/p/android/issues/detail?id=188042
Bug: 24548073

Change-Id: I0d00af384c35a9d863377972318da9db7668118f
parent ae5a53d7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment