Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
zeroing-engine
Commits
43f8406e
Commit
43f8406e
authored
Mar 19, 2020
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0.1版本前最后一次提交
parent
8158cdcc
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
181 additions
and
14 deletions
+181
-14
engine.js
debug/engine.js
+155
-5
engine.js.map
debug/engine.js.map
+1
-1
manifest.json
manifest.json
+1
-1
Container.ts
src/2d/display/Container.ts
+9
-1
DisplayObject.ts
src/2d/display/DisplayObject.ts
+9
-1
EventDispatcher.ts
src/2d/events/EventDispatcher.ts
+6
-5
No files found.
debug/engine.js
View file @
43f8406e
This diff is collapsed.
Click to expand it.
debug/engine.js.map
View file @
43f8406e
This diff is collapsed.
Click to expand it.
manifest.json
View file @
43f8406e
{
"id"
:
"engine"
,
"url"
:
"engine.5afff35dbf1a3f35d5d37785f6235b47b9f6cedd.js"
}
\ No newline at end of file
{
"id"
:
"engine"
,
"url"
:
"engine.85a610a71df748fd9a6ece34f456a06e8f3f1b63.js"
}
\ No newline at end of file
src/2d/display/Container.ts
View file @
43f8406e
...
...
@@ -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
()
{
}
...
...
src/2d/display/DisplayObject.ts
View file @
43f8406e
...
...
@@ -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
;
}
...
...
src/2d/events/EventDispatcher.ts
View file @
43f8406e
...
...
@@ -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
);
}
// listener
s[i]
(event);
// listener(event);
}
else
{
listeners
.
splice
(
i
,
1
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment