Commit 43f8406e authored by rockyl's avatar rockyl

0.1版本前最后一次提交

parent 8158cdcc
This diff is collapsed.
This diff is collapsed.
{"id":"engine","url":"engine.5afff35dbf1a3f35d5d37785f6235b47b9f6cedd.js"}
\ No newline at end of file
{"id":"engine","url":"engine.85a610a71df748fd9a6ece34f456a06e8f3f1b63.js"}
\ No newline at end of file
......@@ -38,7 +38,7 @@ export default class Container extends DisplayObject {
/**
* 为false鼠标事件不再向下传递
*/
mouseChildren: boolean = true;
_mouseChildren: boolean = true;
/**
* 孩子们
* @member {DisplayObject[]}
......@@ -62,6 +62,14 @@ export default class Container extends DisplayObject {
this.afterConstructor();
}
get mouseChildren() {
return this._mouseChildren;
}
set mouseChildren(v) {
this._mouseChildren = v;
}
afterConstructor() {
}
......
......@@ -82,7 +82,7 @@ export class DisplayObject extends EventDispatcher {
/**
* 是否可响应鼠标事件
*/
mouseEnabled: boolean = true;
_mouseEnabled: boolean = true;
/**
* 临时父级,特殊用处
......@@ -136,6 +136,14 @@ export class DisplayObject extends EventDispatcher {
this.addEventListener(Event.REMOVED_FROM_STAGE, this.attachVisibility, this);
}
get mouseEnabled() {
return this._mouseEnabled;
}
set mouseEnabled(v) {
this._mouseEnabled = v;
}
get visible() {
return this.$visible;
}
......
......@@ -203,12 +203,13 @@ export class EventDispatcher extends HashObject {
for (let i = len - 1; i >= 0; i--) {
if (!event["_pd"]) {
if (listeners[i]) {
listeners[i].fn.call(listeners[i].context, event)
//必须做判断,因为有可能出现上面的fn.里执行的就是removeEventListener,导致listeners[i]不存在
if (listeners[i] && listeners[i].once) {
s.removeEventListener(event.type, listeners[i].fn, listeners[i].context);
let listener = listeners[i];
listener.fn.call(listener.context, event)
//必须做判断,因为有可能出现上面的fn.里执行的就是removeEventListener,导致listener不存在
if (listener && listener.once) {
s.removeEventListener(event.type, listener.fn, listener.context);
}
// listeners[i](event);
// listener(event);
} else {
listeners.splice(i, 1);
}
......
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