The latest development version of compose (1.6.0-d...
# compose-desktop
m
The latest development version of compose (1.6.0-dev1383) has completely broken my layouts. The default line spacing of multiline text has been drastically increased. Is this by design or is this a bug?
k
@Ivan Matkov
m
Difference between
1.6.0-dev1369
and
1.6.0-dev1383
from left to right:
i
> Is this by design or is this a bug? Kind of by design. This change was picked up from Google's upstream. I did investigation of the cause and it was behaviour change in Android's 1.6.0-alpha01. To mitigate it, line height was explicitly specified in
MaterialTheme
, so changing only fontSize doesn't really work inside material element. Related PR in our demo - https://github.com/JetBrains/compose-multiplatform-core/pull/996 However, such behaviour already exists in material3, so now it's aligned between them.
🙏 1
m
Many thanks for the quick response. I’ll have to investigate now in how many places I’ll have to apply these changes in my code to get the old layout back again.
👍 1
👍🏻 1
i
https://partnerissuetracker.corp.google.com/issues/321872412
The release notes documentation has been edited to clarify this change in behavior for line height.
To support non-standard text sizes, we encourage users to follow the Material design system and use a different type scale rather than changing the font size directly. Alternatively, users can overwrite the line height like so:
style = LocalTextStyle.current.copy(lineHeight = TextUnit.Unspecified)
, or create a custom
Typography
entirely.