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
1a619360
Commit
1a619360
authored
Mar 31, 2020
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复遮罩问题,修复点击区域重复的问题
parent
099fdbfe
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
23 deletions
+40
-23
engine.js
debug/engine.js
+25
-13
engine.js.map
debug/engine.js.map
+1
-1
manifest.json
manifest.json
+1
-1
Container.ts
src/2d/display/Container.ts
+8
-6
DisplayObject.ts
src/2d/display/DisplayObject.ts
+5
-2
No files found.
debug/engine.js
View file @
1a619360
...
...
@@ -1508,12 +1508,12 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return
this
.
$mask
;
},
set
:
function
(
value
)
{
if
(
value
===
this
)
{
return
;
}
if
(
this
.
$mask
)
{
this
.
$mask
.
renderable
=
true
;
this
.
$mask
.
isUsedToMask
=
false
;
if
(
this
.
$mask
.
parent
)
{
this
.
$mask
.
parent
.
removeChild
(
this
.
$mask
);
}
}
this
.
$mask
=
value
;
if
(
this
.
$mask
)
{
...
...
@@ -1560,7 +1560,6 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}(
EventDispatcher
));
DisplayObject
.
prototype
.
displayObjectUpdateTransform
=
DisplayObject
.
prototype
.
updateTransform
;
DisplayObject
.
prototype
.
displayObjectHitTestPoint
=
DisplayObject
.
prototype
.
hitTestPoint
;
//# sourceMappingURL=DisplayObject.js.map
var
GDispatcher
=
(
function
()
{
function
GDispatcher
()
{
...
...
@@ -2026,6 +2025,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}
}
}
//# sourceMappingURL=utils.js.map
function
transPoint
(
str
,
sep
)
{
if
(
sep
===
void
0
)
{
sep
=
','
;
}
...
...
@@ -2480,7 +2480,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
var
name
=
args
[
0
];
var
dataMapping
=
this
.
getDataMapping
(
name
);
try
{
var
data
=
this
.
getDataByPath
(
dataMapping
.
path
,
undefined
,
tru
e
);
var
data
=
this
.
getDataByPath
(
dataMapping
.
path
,
undefined
,
fals
e
);
if
(
args
[
1
]
!==
undefined
)
{
data
=
data
[
args
[
1
]];
}
...
...
@@ -2858,7 +2858,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
props
[
key
]
=
nameValue
!==
undefined
?
nameValue
:
dataCenter
.
getDataByPath
(
name
);
break
;
case
'env'
:
props
[
key
]
=
env
[
name
]
;
props
[
key
]
=
getDataByPath
(
env
,
name
)
;
break
;
case
'map'
:
this
.
updateProps
(
props
[
key
]
=
{},
args
,
name
,
name
);
...
...
@@ -3415,8 +3415,9 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
if
(
isMouseEvent
===
void
0
)
{
isMouseEvent
=
false
;
}
if
(
!
this
.
visible
)
return
null
;
var
result
=
this
.
hitTestSelf
(
globalPoint
);
if
(
isMouseEvent
&&
!
this
.
mouseChildren
)
return
this
.
hitTestSelf
(
globalPoint
)
;
return
result
;
var
children
=
this
.
children
;
var
length
=
children
.
length
;
var
child
,
hitDisplayObject
;
...
...
@@ -3440,11 +3441,12 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
};
Container
.
prototype
.
hitTestSelfBounds
=
function
(
globalPoint
)
{
if
(
this
.
width
&&
this
.
height
)
{
var
lp
=
this
.
globalToLocal
(
globalPoint
,
DisplayObject
.
_bp
);
if
(
lp
.
x
>
0
&&
lp
.
x
<
this
.
width
&&
lp
.
y
>
0
&&
lp
.
y
<
this
.
height
)
var
_a
=
this
.
getBounds
(),
tx
=
_a
.
x
,
ty
=
_a
.
y
;
var
x
=
globalPoint
.
x
,
y
=
globalPoint
.
y
;
if
(
x
>
tx
&&
x
<
tx
+
this
.
width
&&
y
>
ty
&&
y
<
ty
+
this
.
height
)
return
this
;
}
return
null
;
...
...
@@ -7884,6 +7886,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}
return
requestAnimationFrame
;
}());
var
skipTagNames
=
[
'INPUT'
];
var
Stage
=
(
function
(
_super
)
{
tslib_1
.
__extends
(
Stage
,
_super
);
function
Stage
(
rootDivId
,
desW
,
desH
,
frameRate
,
scaleMode
,
renderType
,
transparent
,
bgColor
)
{
...
...
@@ -8117,6 +8120,9 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
};
Stage
.
prototype
.
onMouseEvent
=
function
(
e
)
{
var
s
=
this
;
if
(
skipTagNames
.
indexOf
(
e
.
target
.
tagName
)
>=
0
)
{
return
;
}
if
(
EventDispatcher
.
_totalMEC
>
0
)
{
var
points
=
void
0
;
var
item
=
s
.
_mouseEventTypes
[
e
.
type
];
...
...
@@ -16650,7 +16656,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
StackContainer
.
prototype
.
pop
=
function
(
dispatch
)
{
if
(
dispatch
===
void
0
)
{
dispatch
=
true
;
}
var
len
=
this
.
children
.
length
;
if
(
len
=
=
0
)
{
if
(
len
<
=
0
)
{
return
false
;
}
this
.
removeChildAt
(
len
-
1
);
...
...
@@ -20118,6 +20124,12 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
value
:
(
isArray
?
curList
[
curIndex
]
:
curList
[
curIndex
].
value
),
writable
:
false
});
Object
.
defineProperty
(
newNode
,
"$data"
,
{
configurable
:
true
,
enumerable
:
false
,
value
:
(
isArray
?
curList
[
curIndex
]
:
curList
[
curIndex
].
value
),
writable
:
false
});
context
.
compiler
.
compile
(
newNode
,
newScope
);
lastNode
=
newNode
;
}
...
...
debug/engine.js.map
View file @
1a619360
This diff is collapsed.
Click to expand it.
manifest.json
View file @
1a619360
{
"id"
:
"engine"
,
"url"
:
"engine.7a271e32dee3c00329926f0b7096a1b62959bd5b.js"
}
\ No newline at end of file
{
"id"
:
"engine"
,
"url"
:
"engine.c62a7b1e88c4bcbbf86609a9b9fe3c2fd353dad2.js"
}
\ No newline at end of file
src/2d/display/Container.ts
View file @
1a619360
...
...
@@ -492,7 +492,8 @@ export default class Container extends DisplayObject {
//如果不可见
if
(
!
this
.
visible
)
return
null
//如果禁止子级的鼠标事件
if
(
isMouseEvent
&&
!
this
.
mouseChildren
)
return
this
.
hitTestSelf
(
globalPoint
);
let
result
=
this
.
hitTestSelf
(
globalPoint
);
if
(
isMouseEvent
&&
!
this
.
mouseChildren
)
return
result
;
var
children
=
this
.
children
;
var
length
=
children
.
length
;
let
child
,
hitDisplayObject
;
...
...
@@ -521,11 +522,12 @@ export default class Container extends DisplayObject {
hitTestSelfBounds
(
globalPoint
)
{
if
(
this
.
width
&&
this
.
height
)
{
let
lp
=
this
.
globalToLocal
(
globalPoint
,
DisplayObject
.
_bp
);
if
(
lp
.
x
>
0
&&
lp
.
x
<
this
.
width
&&
lp
.
y
>
0
&&
lp
.
y
<
this
.
height
let
{
x
:
tx
,
y
:
ty
}
=
this
.
getBounds
();
const
{
x
,
y
}
=
globalPoint
;
if
(
x
>
tx
&&
x
<
tx
+
this
.
width
&&
y
>
ty
&&
y
<
ty
+
this
.
height
)
return
this
;
}
return
null
...
...
src/2d/display/DisplayObject.ts
View file @
1a619360
...
...
@@ -609,14 +609,17 @@ export class DisplayObject extends EventDispatcher {
}
set
mask
(
value
)
{
if
(
value
===
this
){
return
;
}
if
(
this
.
$mask
)
{
//原先有的遮罩,重置属性
this
.
$mask
.
renderable
=
true
;
this
.
$mask
.
isUsedToMask
=
false
;
if
(
this
.
$mask
.
parent
)
{
/*
if (this.$mask.parent) {
this.$mask.parent.removeChild(this.$mask)
//是否销毁
}
}
*/
}
this
.
$mask
=
value
;
...
...
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