Commit d45fe6f0 authored by rockyl's avatar rockyl

ScrollContainer互斥操作

Image加载网络图片相对布局定位问题
parent 88db356e
...@@ -4834,6 +4834,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -4834,6 +4834,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
this._localBoundsSelf.y = -height * this.anchorTexture.y; this._localBoundsSelf.y = -height * this.anchorTexture.y;
this._localBoundsSelf.width = width; this._localBoundsSelf.width = width;
this._localBoundsSelf.height = height; this._localBoundsSelf.height = height;
this.dispatchEvent(Event.RESIZE);
}; };
Sprite.prototype._onAnchorUpdate = function () { Sprite.prototype._onAnchorUpdate = function () {
this._transformID = -1; this._transformID = -1;
...@@ -11254,17 +11255,16 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -11254,17 +11255,16 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
s.autoScroll = false; s.autoScroll = false;
} }
if (s._direction === exports.SCROLL_DIRECTION.VERTICAL) { if (s._direction === exports.SCROLL_DIRECTION.VERTICAL) {
s.lastValue = e.localY; s.lastValue = e.stageY;
} }
else { else {
s.lastValue = e.localX; s.lastValue = e.stageX;
} }
s.speed = 0; s.speed = 0;
s.isMouseDownState = 1; s.isMouseDownState = 1;
registerScrollInstance(this); registerScrollInstance(this);
} }
else if (e.type == MouseEvent.MOUSE_MOVE) { else if (e.type == MouseEvent.MOUSE_MOVE) {
console.log(this.name);
if (s.isMouseDownState == 0) if (s.isMouseDownState == 0)
return; return;
if (s.isMouseDownState == 1) { if (s.isMouseDownState == 1) {
...@@ -11273,10 +11273,10 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -11273,10 +11273,10 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
s.isMouseDownState = 2; s.isMouseDownState = 2;
var currentValue = void 0; var currentValue = void 0;
if (s._direction === exports.SCROLL_DIRECTION.VERTICAL) { if (s._direction === exports.SCROLL_DIRECTION.VERTICAL) {
currentValue = e.localY; currentValue = e.stageY;
} }
else { else {
currentValue = e.localX; currentValue = e.stageX;
} }
s.speed = currentValue - s.lastValue; s.speed = currentValue - s.lastValue;
if (s.speed > s.minDis) { if (s.speed > s.minDis) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
module.exports = {
region: 'oss-cn-hangzhou',
id: 'LTAIqO2wblIxQvwc',
secret: '4brsaSRbRpjxw3oDIxJi6bNMcndIR6',
bucket: 'duiba',
output: '/editor/zeroing/libs'
};
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
"rollup": "rollup -c -o dist/engine.js --environment BUILD:production1", "rollup": "rollup -c -o dist/engine.js --environment BUILD:production1",
"rollup:debug": "rollup -c -m ", "rollup:debug": "rollup -c -m ",
"rename": "node scripts/rename-hash.js dist/engine.js", "rename": "node scripts/rename-hash.js dist/engine.js",
"build": "rm -rf dist&&yarn rollup && yarn rename", "build": "rm -rf dist&&yarn rollup && yarn rename && ali-oss-publish -c oss.config.js -e dist",
"ts": "dts-bundle --name engine --main types/src/index.d.ts --out ../../dist/index.d.ts", "ts": "dts-bundle --name engine --main types/src/index.d.ts --out ../../dist/index.d.ts",
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack -w", "dev": "webpack -w",
......
...@@ -2,6 +2,7 @@ import { ObservablePoint, Point, Rectangle } from '../math'; ...@@ -2,6 +2,7 @@ import { ObservablePoint, Point, Rectangle } from '../math';
import { sign, TextureCache } from '../utils'; import { sign, TextureCache } from '../utils';
// import { BLEND_MODES } from '../const'; // import { BLEND_MODES } from '../const';
import Texture from '../texture/Texture'; import Texture from '../texture/Texture';
import {Event} from '../events/Event';
import Container from './Container'; import Container from './Container';
import { DisplayObject } from "./DisplayObject"; import { DisplayObject } from "./DisplayObject";
...@@ -138,6 +139,8 @@ export default class Sprite extends Container { ...@@ -138,6 +139,8 @@ export default class Sprite extends Container {
this._localBoundsSelf.y = -height * this.anchorTexture.y; this._localBoundsSelf.y = -height * this.anchorTexture.y;
this._localBoundsSelf.width = width; this._localBoundsSelf.width = width;
this._localBoundsSelf.height = height; this._localBoundsSelf.height = height;
this.dispatchEvent(Event.RESIZE);
} }
/** /**
......
...@@ -335,16 +335,15 @@ export class ScrollContainer extends Container { ...@@ -335,16 +335,15 @@ export class ScrollContainer extends Container {
// Tween.kill(s._tweenId); // Tween.kill(s._tweenId);
} }
if (s._direction === SCROLL_DIRECTION.VERTICAL) { if (s._direction === SCROLL_DIRECTION.VERTICAL) {
s.lastValue = e.localY; s.lastValue = e.stageY;
} else { } else {
s.lastValue = e.localX; s.lastValue = e.stageX;
} }
s.speed = 0; s.speed = 0;
s.isMouseDownState = 1; s.isMouseDownState = 1;
registerScrollInstance(this); registerScrollInstance(this);
} else if (e.type == MouseEvent.MOUSE_MOVE) { } else if (e.type == MouseEvent.MOUSE_MOVE) {
console.log(this.name);
if (s.isMouseDownState == 0) return; if (s.isMouseDownState == 0) return;
if (s.isMouseDownState == 1) { if (s.isMouseDownState == 1) {
s.dispatchEvent(Event.ON_SCROLL_START); s.dispatchEvent(Event.ON_SCROLL_START);
...@@ -352,9 +351,9 @@ export class ScrollContainer extends Container { ...@@ -352,9 +351,9 @@ export class ScrollContainer extends Container {
s.isMouseDownState = 2; s.isMouseDownState = 2;
let currentValue: number; let currentValue: number;
if (s._direction === SCROLL_DIRECTION.VERTICAL) { if (s._direction === SCROLL_DIRECTION.VERTICAL) {
currentValue = e.localY; currentValue = e.stageY;
} else { } else {
currentValue = e.localX; currentValue = e.stageX;
} }
s.speed = currentValue - s.lastValue; s.speed = currentValue - s.lastValue;
if (s.speed > s.minDis) { if (s.speed > s.minDis) {
......
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