diff --git a/frameworks/components/ui_label.cpp b/frameworks/components/ui_label.cpp index 2649cf1cfd2b6832df90e935dbb38110dc6a2e28..fd54406d775426d07cf86b9ba57cda7f73af8456 100755 --- a/frameworks/components/ui_label.cpp +++ b/frameworks/components/ui_label.cpp @@ -300,6 +300,11 @@ void UILabel::ReMeasure() InitLabelText(); Style style = GetStyleConst(); style.textColor_ = GetTextColor(); + bool flag = false; + if ((transMap_ != nullptr) && !transMap_->IsInvalid()) { + transMap_->SetInvalid(true); + flag = true; + } labelText_->ReMeasureTextSize(GetContentRect(), style); Point textSize = labelText_->GetTextSize(); switch (lineBreakMode_) { @@ -322,6 +327,9 @@ void UILabel::ReMeasure() default: break; } + if ((transMap_ != nullptr) && flag) { + transMap_->SetInvalid(false); + } } void UILabel::RemeasureForMarquee(int16_t textWidth)