Commit 864665b3 authored by rockyl's avatar rockyl

修复遮罩嵌套问题

修改滚动方向
parent 620d3045
......@@ -11089,6 +11089,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
_this.maxSpeed = 100;
_this.fSpeed = 20;
_this.paramXY = "y";
_this.paramSize = "height";
_this.stopTimes = -1;
_this.isMouseDownState = 0;
_this.autoScroll = false;
......@@ -11189,7 +11190,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}
Object.defineProperty(ScrollContainer.prototype, "maxDistance", {
get: function () {
return this.viewPort.height;
return this.viewPort[this.paramSize];
},
enumerable: true,
configurable: true
......@@ -11200,25 +11201,31 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
},
set: function (value) {
this._direction = value;
var s = this;
if (value === exports.SCROLL_DIRECTION.VERTICAL) {
s.distance = s.height;
s.paramXY = "y";
}
else {
s.distance = s.width;
s.paramXY = "x";
}
this.updateDirection();
},
enumerable: true,
configurable: true
});
ScrollContainer.prototype.updateDirection = function () {
var s = this;
if (this._direction === exports.SCROLL_DIRECTION.VERTICAL) {
s.distance = s.height;
s.paramXY = "y";
s.paramSize = 'height';
}
else {
s.distance = s.width;
s.paramXY = "x";
s.paramSize = 'width';
}
};
ScrollContainer.prototype.updateViewRect = function () {
var s = this;
s.maskObj.clear();
s.maskObj.beginFill("#000000");
s.maskObj.drawRect(0, 0, s.width, s.height);
s.maskObj.endFill();
this.updateDirection();
};
ScrollContainer.prototype.onMouseEvent = function (e) {
var s = this;
......
This diff is collapsed.
......@@ -132,6 +132,7 @@ export class ScrollContainer extends Container {
*/
public fSpeed: number = 20;
protected paramXY: string = "y";
protected paramSize: string = "height";
private stopTimes: number = -1;
private isMouseDownState: number = 0;
/**
......@@ -260,7 +261,7 @@ export class ScrollContainer extends Container {
}
get maxDistance() {
return this.viewPort.height;
return this.viewPort[this.paramSize];
}
get direction(): SCROLL_DIRECTION {
......@@ -270,13 +271,19 @@ export class ScrollContainer extends Container {
set direction(value: SCROLL_DIRECTION) {
this._direction = value;
this.updateDirection();
}
protected updateDirection(){
let s = this;
if (value === SCROLL_DIRECTION.VERTICAL) {
if (this._direction === SCROLL_DIRECTION.VERTICAL) {
s.distance = s.height;
s.paramXY = "y";
s.paramSize = 'height';
} else {
s.distance = s.width;
s.paramXY = "x";
s.paramSize = 'width';
}
}
......@@ -292,6 +299,8 @@ export class ScrollContainer extends Container {
s.maskObj.beginFill("#000000");
s.maskObj.drawRect(0, 0, s.width, s.height);
s.maskObj.endFill();
this.updateDirection();
}
private onMouseEvent(e: MouseEvent): void {
......
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