@cc-component/cc-ex-component 1.9.6 → 1.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Vec2 } from 'cc';
|
|
1
2
|
import { _decorator, Component, Enum, Event, EventMouse, EventTouch, instantiate, Mask, math, Node, NodeEventType, NodePool, Prefab, ScrollView, UIOpacity, UITransform } from 'cc';
|
|
2
3
|
const { ccclass, property, executionOrder, disallowMultiple, help } = _decorator;
|
|
3
4
|
|
|
@@ -1432,7 +1433,13 @@ export class YXCollectionView extends Component {
|
|
|
1432
1433
|
private onScrollBegan() {
|
|
1433
1434
|
}
|
|
1434
1435
|
|
|
1435
|
-
private onScrolling() {
|
|
1436
|
+
private onScrolling(sv: ScrollView) {
|
|
1437
|
+
let maxOffset = sv.getMaxScrollOffset()
|
|
1438
|
+
let minOffset = Vec2.ZERO
|
|
1439
|
+
let curOffset = sv.getScrollOffset()
|
|
1440
|
+
if (math.Vec2.distance(maxOffset, curOffset) < 0.01 || math.Vec2.distance(minOffset, curOffset) < 0.01)
|
|
1441
|
+
sv.stopAutoScroll()
|
|
1442
|
+
|
|
1436
1443
|
// 在滚动过程中仅仅是标记更新状态,具体更新业务统一到 update 里面处理,但是 layout 设置了实时更新的情况时例外
|
|
1437
1444
|
if (this.layout.shouldUpdateAttributesForBoundsChange()) {
|
|
1438
1445
|
this.reloadVisibleElements()
|