From 24578d0193cd7913e617911a78889572f92518f4 Mon Sep 17 00:00:00 2001 From: zoulinken Date: Sat, 9 Sep 2023 17:16:00 +0800 Subject: [PATCH] =?UTF-8?q?fixed=2058e3db8=20from=20https://gitee.com/xzke?= =?UTF-8?q?n/arkui=5Face=5Fengine/pulls/19419=20=E4=BF=AE=E5=A4=8Dvideo?= =?UTF-8?q?=E5=85=A8=E5=B1=8F=E6=97=B6=E5=8A=A8=E6=80=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=97=A0=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zoulinken Change-Id: I0038fc16877b15f67ca35fb5b5515d46f6947b36 --- .../video/video_full_screen_pattern.cpp | 31 ++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/frameworks/core/components_ng/pattern/video/video_full_screen_pattern.cpp b/frameworks/core/components_ng/pattern/video/video_full_screen_pattern.cpp index c9980f2b2f1..a1d02c354f2 100644 --- a/frameworks/core/components_ng/pattern/video/video_full_screen_pattern.cpp +++ b/frameworks/core/components_ng/pattern/video/video_full_screen_pattern.cpp @@ -13,16 +13,15 @@ * limitations under the License. */ -# include "core/components_ng/pattern/video/video_full_screen_pattern.h" +#include "core/components_ng/pattern/video/video_full_screen_pattern.h" -#include "core/components_ng/pattern/video/video_full_screen_node.h" #include "core/components_ng/pattern/image/image_pattern.h" +#include "core/components_ng/pattern/video/video_full_screen_node.h" namespace OHOS::Ace::NG { void VideoFullScreenPattern::InitFullScreenParam(const RefPtr& videoPattern, - const RefPtr& renderSurface, - const RefPtr& mediaPlayer, - const RefPtr& context) + const RefPtr& renderSurface, const RefPtr& mediaPlayer, + const RefPtr& context) { UpdateMediaParam(mediaPlayer, renderSurface, context); videoPattern->ResetMediaParam(); @@ -56,7 +55,7 @@ void VideoFullScreenPattern::RequestFullScreen(const RefPtr& videoNod parentConstraint.maxSize.SetHeight(rootHeight); auto geometryNode = fullScreenNode->GetGeometryNode(); geometryNode->SetParentLayoutConstraint(parentConstraint); - geometryNode->SetMarginFrameOffset(OffsetF {0.0f, 0.0f}); + geometryNode->SetMarginFrameOffset(OffsetF { 0.0f, 0.0f }); fullScreenNode->MarkModifyDone(); fullScreenNode->RebuildRenderContextTree(); fullScreenNode->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF_AND_CHILD); @@ -104,30 +103,20 @@ void VideoFullScreenPattern::UpdateState() auto videoNode = videoPattern->GetHost(); CHECK_NULL_VOID(videoNode); auto videoLayout = videoNode->GetLayoutProperty(); - bool isChanged = false; - if (videoLayout->HasObjectFit() && - (fullScreenLayout->GetObjectFit() != videoLayout->GetObjectFit())) { - isChanged = true; + if (videoLayout->HasObjectFit() && (fullScreenLayout->GetObjectFit() != videoLayout->GetObjectFit())) { fullScreenLayout->UpdateObjectFit(videoLayout->GetObjectFit().value()); } - if (videoLayout->HasVideoSource() && - (fullScreenLayout->GetVideoSource() != videoLayout->GetVideoSource())) { - isChanged = true; + if (videoLayout->HasVideoSource() && (fullScreenLayout->GetVideoSource() != videoLayout->GetVideoSource())) { fullScreenLayout->UpdateVideoSource(videoLayout->GetVideoSource().value()); } if (videoLayout->HasPosterImageInfo() && (fullScreenLayout->GetPosterImageInfo() != videoLayout->GetPosterImageInfo())) { - isChanged = true; fullScreenLayout->UpdatePosterImageInfo(videoLayout->GetPosterImageInfo().value()); } - if (videoLayout->HasControls() && ( - fullScreenLayout->GetControls() != videoLayout->GetControls())) { - isChanged = true; + if (videoLayout->HasControls() && (fullScreenLayout->GetControls() != videoLayout->GetControls())) { fullScreenLayout->UpdateControls(videoLayout->GetControls().value()); } - if (isChanged) { - fullScreenNode->MarkModifyDone(); - fullScreenNode->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF_AND_CHILD); - } + fullScreenNode->MarkModifyDone(); + fullScreenNode->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF_AND_CHILD); } } // namespace OHOS::Ace::NG -- Gitee