mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Make sure to call setHeightOverride as well on TextStyle and StrutStyle (flutter/engine#50920)
This fixes https://github.com/flutter/flutter/issues/143877 We apparently need to call `setHeightOverride(true)` on `TextStyle` and `StrutStyle` objects in order to properly apply the height.
This commit is contained in:
parent
45b0c5ef88
commit
d1d7c08ce9
@ -33,6 +33,7 @@ SKWASM_EXPORT void strutStyle_setFontSize(StrutStyle* style,
|
||||
|
||||
SKWASM_EXPORT void strutStyle_setHeight(StrutStyle* style, SkScalar height) {
|
||||
style->setHeight(height);
|
||||
style->setHeightOverride(true);
|
||||
}
|
||||
|
||||
SKWASM_EXPORT void strutStyle_setHalfLeading(StrutStyle* style,
|
||||
|
||||
@ -96,6 +96,7 @@ SKWASM_EXPORT void textStyle_setWordSpacing(TextStyle* style,
|
||||
|
||||
SKWASM_EXPORT void textStyle_setHeight(TextStyle* style, SkScalar height) {
|
||||
style->setHeight(height);
|
||||
style->setHeightOverride(true);
|
||||
}
|
||||
|
||||
SKWASM_EXPORT void textStyle_setHalfLeading(TextStyle* style,
|
||||
|
||||
@ -68,6 +68,11 @@ Future<void> testMain() async {
|
||||
layoutWidth: 50, paragraphHeight: 1.5);
|
||||
});
|
||||
|
||||
test('text styles - text style height overriding paragraph height', () async {
|
||||
await testTextStyle('text style height and paragraph style height',
|
||||
layoutWidth: 50, paragraphHeight: 1.5, height: 2.0);
|
||||
});
|
||||
|
||||
test('text styles - paragraph text height behavior', () async {
|
||||
await testTextStyle('paragraph text height behavior',
|
||||
layoutWidth: 50,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user