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
ff29b190
Commit
ff29b190
authored
Mar 23, 2020
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复html视图不能滚动的限制
parent
43f8406e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
26 deletions
+39
-26
manifest.json
manifest.json
+1
-1
FloatDisplay.ts
src/2d/display/FloatDisplay.ts
+35
-23
Stage.ts
src/2d/display/Stage.ts
+3
-2
No files found.
manifest.json
View file @
ff29b190
{
"id"
:
"engine"
,
"url"
:
"engine.85a610a71df748fd9a6ece34f456a06e8f3f1b63.js"
}
{
"id"
:
"engine"
,
"url"
:
"engine.47eb390007c368d3dc5648734153301ebead724b.js"
}
\ No newline at end of file
\ No newline at end of file
src/2d/display/FloatDisplay.ts
View file @
ff29b190
...
@@ -83,7 +83,20 @@ export class FloatDisplay extends DisplayObject {
...
@@ -83,7 +83,20 @@ export class FloatDisplay extends DisplayObject {
}
}
});
});
s
.
addEventListener
(
Event
.
ADDED_TO_STAGE
,
function
(
e
:
Event
)
{
s
.
addEventListener
(
Event
.
ADDED_TO_STAGE
,
function
(
e
:
Event
)
{
if
(
!
container
){
this
.
addHtmlElement
();
},
s
);
this
.
_transformID
=
-
1
;
}
addHtmlElement
()
{
let
s
=
this
;
if
(
!
s
.
stage
){
return
;
}
if
(
!
container
)
{
container
=
document
.
createElement
(
'div'
);
container
=
document
.
createElement
(
'div'
);
container
.
style
.
position
=
"absolute"
;
container
.
style
.
position
=
"absolute"
;
container
.
style
.
left
=
"0"
;
container
.
style
.
left
=
"0"
;
...
@@ -104,9 +117,6 @@ export class FloatDisplay extends DisplayObject {
...
@@ -104,9 +117,6 @@ export class FloatDisplay extends DisplayObject {
}
}
}
}
}
}
});
this
.
_transformID
=
-
1
;
}
}
get
htmlElement
()
{
get
htmlElement
()
{
...
@@ -126,7 +136,7 @@ export class FloatDisplay extends DisplayObject {
...
@@ -126,7 +136,7 @@ export class FloatDisplay extends DisplayObject {
* @param {HtmlElement} htmlElement 需要封装起来的html元素的引用。你可以通过这个引用来调用或设置此元素自身的属性方法和事件,甚至是样式
* @param {HtmlElement} htmlElement 需要封装起来的html元素的引用。你可以通过这个引用来调用或设置此元素自身的属性方法和事件,甚至是样式
*/
*/
protected
init
(
htmlElement
:
any
):
void
{
protected
init
(
htmlElement
:
any
):
void
{
if
(
!
htmlElement
)
{
if
(
!
htmlElement
)
{
return
;
return
;
}
}
let
s
=
this
;
let
s
=
this
;
...
@@ -160,6 +170,8 @@ export class FloatDisplay extends DisplayObject {
...
@@ -160,6 +170,8 @@ export class FloatDisplay extends DisplayObject {
s
.
_localBoundsSelf
.
width
=
w
;
s
.
_localBoundsSelf
.
width
=
w
;
s
.
_localBoundsSelf
.
height
=
h
;
s
.
_localBoundsSelf
.
height
=
h
;
s
.
_htmlElement
=
she
;
s
.
_htmlElement
=
she
;
this
.
addHtmlElement
();
}
}
/**
/**
...
...
src/2d/display/Stage.ts
View file @
ff29b190
...
@@ -438,7 +438,7 @@ export class Stage extends Container {
...
@@ -438,7 +438,7 @@ export class Stage extends Container {
s
.
dispatchEvent
(
Event
.
ON_INIT_STAGE
);
s
.
dispatchEvent
(
Event
.
ON_INIT_STAGE
);
// }
// }
},
100
);
},
100
);
let
rc
=
canvas
;
//s.rootDiv;
let
rc
=
s
.
rootDiv
;
//canvas
let
mouseEvent
=
s
.
onMouseEvent
.
bind
(
s
);
let
mouseEvent
=
s
.
onMouseEvent
.
bind
(
s
);
//鼠标事件
//鼠标事件
if
(
osType
!=
"pc"
)
{
if
(
osType
!=
"pc"
)
{
...
@@ -648,8 +648,9 @@ export class Stage extends Container {
...
@@ -648,8 +648,9 @@ export class Stage extends Container {
cp
=
new
Point
();
cp
=
new
Point
();
}
}
let
rootDiv
=
s
.
rootDiv
;
let
doc
=
document
.
documentElement
;
let
doc
=
document
.
documentElement
;
let
box
=
points
[
o
].
target
.
getBoundingClientRect
();
let
box
=
rootDiv
.
getBoundingClientRect
();
//points[o].target
let
left
=
box
.
left
+
window
.
pageXOffset
-
doc
.
clientLeft
;
let
left
=
box
.
left
+
window
.
pageXOffset
-
doc
.
clientLeft
;
let
top
=
box
.
top
+
window
.
pageYOffset
-
doc
.
clientTop
;
let
top
=
box
.
top
+
window
.
pageYOffset
-
doc
.
clientTop
;
cp
.
x
=
(
points
[
o
].
pageX
-
left
)
*
devicePixelRatio
;
cp
.
x
=
(
points
[
o
].
pageX
-
left
)
*
devicePixelRatio
;
...
...
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