Commit c1a8fe24 authored by rockyl's avatar rockyl

init

parent 20a02e96
......@@ -3,6 +3,8 @@ import Graphics from "../graphics/Graphics";
import {MouseEvent} from "../events/MouseEvent";
import {Event} from "../events/Event";
import {SCROLL_DIRECTION} from "../const";
import {Tween} from "../tween/Tween";
import {Ease} from "../tween/Ease";
// import Tween from "../../tweenSimple/Tween";
......@@ -231,7 +233,7 @@ export class ScrollViewBase extends Container {
tarP = s.distance - s.maxDistance;
}
}*/
if(view[s.paramXY] < s.distance - s.maxDistance){
if (view[s.paramXY] < s.distance - s.maxDistance) {
if (s.distance < s.maxDistance) {
tarP = s.distance - s.maxDistance;
}
......@@ -270,7 +272,7 @@ export class ScrollViewBase extends Container {
return this.calMaxDistance();
}
protected calMaxDistance(){
protected calMaxDistance() {
return this.viewPort[this.paramSize] + this.viewPort.getLocalBounds()[this.paramXY]
}
......@@ -418,11 +420,18 @@ export class ScrollViewBase extends Container {
// if (s.speed == 0) {
// s.dispatchEvent(Event.ON_SCROLL_START);
// }
s.isStop = true;
s.isMouseDownState = 0;
if(time > 0){
Tween.get(s.viewPort, null, null, true)
.to({[s.paramXY]: -dis}, time, Ease.cubicInOut);
}else{
s.viewPort[s.paramXY] = -dis;
}
}
}
public destroy(): void {
let s = this;
......
......@@ -23,7 +23,7 @@ class AlignManager {
const list = this.alignList;
list.forEach((v: Container) => {
if(v.destroyed){
if (v.destroyed) {
return;
}
this.autoSize(v); // 去调整大小
......@@ -32,12 +32,13 @@ class AlignManager {
// 要在这里单独检查,因为对齐一次后可能遇到其父节点需要对齐导致其再对齐一次
list.forEach((v) => {
if(v.destroyed){
if (v.destroyed) {
return;
}
if (v.alignMode === ALIGN_MODE.ONCE) { // 如果是单次对齐则一次运算之后就关闭它
v.alignEnabled = false;
}
v.onLayoutComplete && v.onLayoutComplete();
});
// 干掉列表
list.length = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment