You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using the SZ property for dynamic text in the TextLayer, the height parameter is ignored. This means that if a larger text is passed that exceeds the size of the SZ box, the content will overflow and go outside the box.
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes (R.raw.paragraphtext))
val progress by animateLottieCompositionAsState(composition)
val mapTypeFace = composition?.fonts?.map { (k, v) ->
k to ( v.typeface ?: DEFAULT)
}?.toMap()
val dynamicProperties = rememberLottieDynamicProperties(
rememberLottieDynamicProperty(
property = LottieProperty.TEXT,
value = "Lottie is a great library to add animated files into your app. In this article, we are going to see..",
keyPath = arrayOf("...") // Key path
),
)
Box {
LottieAnimation(
composition = composition,
progress = { progress },
contentScale = ContentScale.FillBounds,
modifier = Modifier.fillMaxSize(),
dynamicProperties = dynamicProperties,
fontMap = mapTypeFace,
)
}
TextLayer supports multiline text as indicated by the "sz": [380, 84] property. However, there seems to be an issue with restricting the height of the text. Unfortunately, the codebase does not consider the height parameter, which is why the height restriction is not working properly.
Screenshots
The text was updated successfully, but these errors were encountered:
Describe the bug
When using the SZ property for dynamic text in the TextLayer, the height parameter is ignored. This means that if a larger text is passed that exceeds the size of the SZ box, the content will overflow and go outside the box.
What version of Lottie did you test this on?
What version of Android did you test this on?
Steps To Reproduce
Please refer the bellow code:
@composable
fun DynamicTextDemo() {
}
JSON Structure for Multiline:
"t": { "d": { "k": [{ "s": { "sz": [380, 84], "ps": [0, -18.8397216796875], "s": 24, "f": "Arial-Bold", "t": "dynamic_text_1", "ca": 0, "j": 0, "tr": 20, "lh": 49, "ls": 0, "fc": [0.133, 0.133, 0.133] }, "t": 0 }] }
TextLayer supports multiline text as indicated by the "sz": [380, 84] property. However, there seems to be an issue with restricting the height of the text. Unfortunately, the codebase does not consider the height parameter, which is why the height restriction is not working properly.
Screenshots
The text was updated successfully, but these errors were encountered: