diff --git a/.gitee/CODEOWNERS b/.gitee/CODEOWNERS index 275ba6f6f32812eed4d34581773dadc68af4f559..ad9021c12af801aead451116fa61fc380f68a973 100644 --- a/.gitee/CODEOWNERS +++ b/.gitee/CODEOWNERS @@ -91,6 +91,7 @@ frameworks/core/components_ng/pattern/form/ @arondave @arcticsun frameworks/core/components_ng/pattern/gauge/ @Hu_ZeQi frameworks/core/components_ng/pattern/gesture/ @zheng-qiyi frameworks/core/components_ng/pattern/grid/ @zcdqs +frameworks/core/components_ng/pattern/grid/irregular/ @zhoutianer frameworks/core/components_ng/pattern/grid_col/ @xiexiyun frameworks/core/components_ng/pattern/grid_container/ @xiexiyun frameworks/core/components_ng/pattern/grid_row/ @xiexiyun diff --git a/frameworks/core/components_ng/pattern/grid/grid_pattern.cpp b/frameworks/core/components_ng/pattern/grid/grid_pattern.cpp index 4d858b97f226b8211f99325db736daeabc52a969..ea4ab0a2cabe8c6d4341751f4c4ce53d4a3c4400 100644 --- a/frameworks/core/components_ng/pattern/grid/grid_pattern.cpp +++ b/frameworks/core/components_ng/pattern/grid/grid_pattern.cpp @@ -411,6 +411,7 @@ bool GridPattern::OnDirtyLayoutWrapperSwap(const RefPtr& dirty, c } ProcessEvent(indexChanged, gridLayoutInfo_.currentHeight_ - gridLayoutInfo_.prevHeight_); gridLayoutInfo_.prevHeight_ = gridLayoutInfo_.currentHeight_; + gridLayoutInfo_.extraOffset_.reset(); SetScrollSource(SCROLL_FROM_NONE); UpdateScrollBarOffset(); if (config.frameSizeChange) { diff --git a/frameworks/core/components_ng/pattern/grid/irregular/grid_irregular_layout_algorithm.cpp b/frameworks/core/components_ng/pattern/grid/irregular/grid_irregular_layout_algorithm.cpp index d90dfdc480b031454f814e9fe99ac04cf2e12b7f..8d7d65ae39243a87264221002b765c498b19a680 100644 --- a/frameworks/core/components_ng/pattern/grid/irregular/grid_irregular_layout_algorithm.cpp +++ b/frameworks/core/components_ng/pattern/grid/irregular/grid_irregular_layout_algorithm.cpp @@ -50,10 +50,6 @@ void GridIrregularLayoutAlgorithm::Measure(LayoutWrapper* layoutWrapper) gridLayoutInfo_.currentOffset_ = postJumpOffset_; MeasureOnOffset(mainSize); } - if (gridLayoutInfo_.extraOffset_.has_value()) { - gridLayoutInfo_.currentOffset_ += gridLayoutInfo_.extraOffset_.value(); - gridLayoutInfo_.extraOffset_.reset(); - } } else { MeasureOnOffset(mainSize); } @@ -119,6 +115,10 @@ void GridIrregularLayoutAlgorithm::Init(const RefPtr& props) info.crossCount_ = static_cast(crossLens_.size()); CheckForReset(); + + if (info.extraOffset_) { + postJumpOffset_ += *info.extraOffset_; + } } namespace { diff --git a/frameworks/core/components_ng/pattern/waterflow/layout/top_down/water_flow_segmented_layout.cpp b/frameworks/core/components_ng/pattern/waterflow/layout/top_down/water_flow_segmented_layout.cpp index 8cf049b5fe5a5eba3fdd3f467cc94160bc9684ec..0218eda051f5d0dbf73b420496dee023a6a4abcb 100644 --- a/frameworks/core/components_ng/pattern/waterflow/layout/top_down/water_flow_segmented_layout.cpp +++ b/frameworks/core/components_ng/pattern/waterflow/layout/top_down/water_flow_segmented_layout.cpp @@ -22,8 +22,8 @@ #include "core/components_ng/base/frame_node.h" #include "core/components_ng/layout/layout_wrapper.h" #include "core/components_ng/pattern/waterflow/layout/top_down/water_flow_layout_info.h" -#include "core/components_ng/pattern/waterflow/water_flow_layout_property.h" #include "core/components_ng/pattern/waterflow/layout/water_flow_layout_utils.h" +#include "core/components_ng/pattern/waterflow/water_flow_layout_property.h" #include "core/components_ng/pattern/waterflow/water_flow_pattern.h" #include "core/components_ng/pattern/waterflow/water_flow_sections.h" #include "core/components_ng/property/calc_length.h" @@ -178,6 +178,10 @@ void WaterFlowSegmentedLayout::Init(const SizeF& frameSize) if (!wrapper_->IsConstraintNoChanged()) { postJumpOffset_ = PrepareJump(info_); } + + if (info_->extraOffset_) { + postJumpOffset_ += *info_->extraOffset_; + } } void WaterFlowSegmentedLayout::SegmentInit( @@ -334,10 +338,6 @@ void WaterFlowSegmentedLayout::MeasureOnJump(int32_t jumpIdx) info_->align_ = TransformAutoScroll(item); } info_->currentOffset_ = SolveJumpOffset(item) + postJumpOffset_; - if (info_->extraOffset_.has_value()) { - info_->currentOffset_ += info_->extraOffset_.value(); - info_->extraOffset_.reset(); - } Fill(jumpIdx); info_->Sync(mainSize_, false); diff --git a/frameworks/core/components_ng/pattern/waterflow/water_flow_pattern.cpp b/frameworks/core/components_ng/pattern/waterflow/water_flow_pattern.cpp index 6e3fd807eceb405509ae71b879f0c41ed1c7e9db..61c2d168f3138977b661db20cd843e7ccd41d720 100644 --- a/frameworks/core/components_ng/pattern/waterflow/water_flow_pattern.cpp +++ b/frameworks/core/components_ng/pattern/waterflow/water_flow_pattern.cpp @@ -262,6 +262,7 @@ bool WaterFlowPattern::OnDirtyLayoutWrapperSwap(const RefPtr& dir prevOffset_ = layoutInfo_->Offset(); layoutInfo_->jumpIndex_ = EMPTY_JUMP_INDEX; layoutInfo_->targetIndex_.reset(); + layoutInfo_->extraOffset_.reset(); UpdateScrollBarOffset(); CheckScrollable();