mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2025-03-02 10:16:42 +00:00
!35529 Fix:Toggle button 组件更新后FontSize不一致
Merge pull request !35529 from yangziyong/toggle_button
This commit is contained in:
commit
0617607abd
@ -572,9 +572,7 @@ void ToggleButtonPattern::InitButtonAndText()
|
||||
CHECK_NULL_VOID(textNode);
|
||||
auto textLayoutProperty = textNode->GetLayoutProperty<TextLayoutProperty>();
|
||||
CHECK_NULL_VOID(textLayoutProperty);
|
||||
if (!textLayoutProperty->HasFontSize()) {
|
||||
textLayoutProperty->UpdateFontSize(textFontSize_);
|
||||
} else {
|
||||
if (textLayoutProperty->HasFontSize()) {
|
||||
layoutProperty->UpdateFontSize(textLayoutProperty->GetFontSizeValue(textFontSize_));
|
||||
}
|
||||
layoutProperty->UpdateLabel(textLayoutProperty->GetContentValue(""));
|
||||
|
@ -355,7 +355,7 @@ HWTEST_F(ToggleButtonTestNg, ToggleButtonPatternTest007, TestSize.Level1)
|
||||
ASSERT_NE(textNode, nullptr);
|
||||
auto textLayoutProperty = textNode->GetLayoutProperty<TextLayoutProperty>();
|
||||
ASSERT_NE(textLayoutProperty, nullptr);
|
||||
EXPECT_EQ(textLayoutProperty->GetFontSizeValue(childFontSize).Value(), dimensionValue);
|
||||
EXPECT_EQ(textLayoutProperty->GetFontSizeValue(childFontSize).Value(), childDimensionValue);
|
||||
|
||||
/**
|
||||
* @tc.steps: step4. Creat child node and set font size.
|
||||
|
Loading…
x
Reference in New Issue
Block a user