Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
renderingEngine
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
王剑峰
renderingEngine
Commits
88db356e
Commit
88db356e
authored
Dec 06, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ScrollContainer互斥处理
parent
7127aca9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
4 deletions
+59
-4
engine.js
debug/engine.js
+26
-1
engine.js.map
debug/engine.js.map
+1
-1
ScrollContainer.ts
src/2d/ui/ScrollContainer.ts
+24
-1
launcher.ts
src/zeroing/launcher.ts
+7
-0
utils.ts
src/zeroing/utils/utils.ts
+1
-1
No files found.
debug/engine.js
View file @
88db356e
...
...
@@ -1727,7 +1727,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
node
[
targetKey
]
=
value
;
}
function
getDataByPath
(
scope
,
path
,
throwException
)
{
var
func
=
new
Function
(
'scope'
,
"return scope"
+
(
path
===
undefined
?
''
:
(
'.'
+
path
)
));
var
func
=
new
Function
(
'scope'
,
"return scope"
+
(
path
?
(
'.'
+
path
)
:
''
));
try
{
return
func
(
scope
);
}
...
...
@@ -11073,6 +11073,18 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return
EditableText
;
}(
TextField
));
var
queue
=
[];
function
registerScrollInstance
(
scrollContainer
)
{
while
(
queue
.
length
>
0
)
{
var
item
=
queue
.
shift
();
if
(
scrollContainer
)
{
item
.
cancelScroll
();
}
}
if
(
scrollContainer
)
{
queue
.
push
(
scrollContainer
);
}
}
var
ScrollContainer
=
(
function
(
_super
)
{
tslib_1
.
__extends
(
ScrollContainer
,
_super
);
function
ScrollContainer
(
maxDistance
,
isFull
)
{
...
...
@@ -11228,6 +11240,9 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
s
.
maskObj
.
endFill
();
this
.
updateDirection
();
};
ScrollContainer
.
prototype
.
cancelScroll
=
function
()
{
this
.
isMouseDownState
=
0
;
};
ScrollContainer
.
prototype
.
onMouseEvent
=
function
(
e
)
{
var
s
=
this
;
var
view
=
s
.
viewPort
;
...
...
@@ -11246,8 +11261,10 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}
s
.
speed
=
0
;
s
.
isMouseDownState
=
1
;
registerScrollInstance
(
this
);
}
else
if
(
e
.
type
==
MouseEvent
.
MOUSE_MOVE
)
{
console
.
log
(
this
.
name
);
if
(
s
.
isMouseDownState
==
0
)
return
;
if
(
s
.
isMouseDownState
==
1
)
{
...
...
@@ -11294,6 +11311,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
s
.
dispatchEvent
(
Event
.
ON_SCROLL_STOP
);
}
s
.
isMouseDownState
=
0
;
registerScrollInstance
();
}
};
ScrollContainer
.
prototype
.
scrollTo
=
function
(
dis
,
time
)
{
...
...
@@ -12883,6 +12901,12 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return
launchWithConfig
(
config
,
onAssetsProgress
,
onAssetsComplete
);
});
}
function
launchWithLocalStorage
(
id
,
onAssetsProgress
,
onAssetsComplete
)
{
var
storeKey
=
'preview-project-'
+
id
;
var
data
=
localStorage
.
getItem
(
storeKey
);
var
dataObj
=
JSON
.
parse
(
data
);
return
launchWithConfig
(
dataObj
,
onAssetsProgress
,
onAssetsComplete
);
}
function
launchWithConfig
(
config
,
onAssetsProgress
,
onAssetsComplete
)
{
return
new
Promise
(
function
(
resolve
)
{
var
_a
=
config
.
options
,
containerID
=
_a
.
containerID
,
designWidth
=
_a
.
designWidth
,
designHeight
=
_a
.
designHeight
,
frameRate
=
_a
.
frameRate
,
scaleMode
=
_a
.
scaleMode
,
rendererType
=
_a
.
rendererType
;
...
...
@@ -12973,6 +12997,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
exports
.
jsonp
=
jsonp
;
exports
.
launch
=
launch
;
exports
.
launchWithConfig
=
launchWithConfig
;
exports
.
launchWithLocalStorage
=
launchWithLocalStorage
;
exports
.
linkedFlag
=
linkedFlag
;
exports
.
md5
=
md5
;
exports
.
nodeScheme
=
nodeScheme
;
...
...
debug/engine.js.map
View file @
88db356e
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/2d/ui/ScrollContainer.ts
View file @
88db356e
...
...
@@ -6,6 +6,20 @@ import {SCROLL_DIRECTION} from "../const";
// import Tween from "../../tweenSimple/Tween";
let
queue
:
ScrollContainer
[]
=
[];
function
registerScrollInstance
(
scrollContainer
?)
{
while
(
queue
.
length
>
0
)
{
let
item
=
queue
.
shift
();
if
(
scrollContainer
){
item
.
cancelScroll
();
}
}
if
(
scrollContainer
){
queue
.
push
(
scrollContainer
);
}
}
/**
* 滚动视图
* @class ScrollPage
...
...
@@ -275,7 +289,7 @@ export class ScrollContainer extends Container {
this
.
updateDirection
();
}
protected
updateDirection
(){
protected
updateDirection
()
{
let
s
=
this
;
if
(
this
.
_direction
===
SCROLL_DIRECTION
.
VERTICAL
)
{
s
.
distance
=
s
.
height
;
...
...
@@ -304,6 +318,10 @@ export class ScrollContainer extends Container {
this
.
updateDirection
();
}
cancelScroll
()
{
this
.
isMouseDownState
=
0
;
}
private
onMouseEvent
(
e
:
MouseEvent
):
void
{
let
s
=
this
;
let
view
:
any
=
s
.
viewPort
;
...
...
@@ -323,7 +341,10 @@ export class ScrollContainer extends Container {
}
s
.
speed
=
0
;
s
.
isMouseDownState
=
1
;
registerScrollInstance
(
this
);
}
else
if
(
e
.
type
==
MouseEvent
.
MOUSE_MOVE
)
{
console
.
log
(
this
.
name
);
if
(
s
.
isMouseDownState
==
0
)
return
;
if
(
s
.
isMouseDownState
==
1
)
{
s
.
dispatchEvent
(
Event
.
ON_SCROLL_START
);
...
...
@@ -365,6 +386,8 @@ export class ScrollContainer extends Container {
s
.
dispatchEvent
(
Event
.
ON_SCROLL_STOP
);
}
s
.
isMouseDownState
=
0
;
registerScrollInstance
();
}
// }
}
...
...
src/zeroing/launcher.ts
View file @
88db356e
...
...
@@ -27,6 +27,13 @@ export function launch(url, onAssetsProgress, onAssetsComplete) {
)
}
export
function
launchWithLocalStorage
(
id
,
onAssetsProgress
,
onAssetsComplete
){
const
storeKey
=
'preview-project-'
+
id
;
let
data
=
localStorage
.
getItem
(
storeKey
);
let
dataObj
=
JSON
.
parse
(
data
);
return
launchWithConfig
(
dataObj
,
onAssetsProgress
,
onAssetsComplete
);
}
export
function
launchWithConfig
(
config
,
onAssetsProgress
,
onAssetsComplete
)
{
return
new
Promise
(
resolve
=>
{
...
...
src/zeroing/utils/utils.ts
View file @
88db356e
...
...
@@ -45,7 +45,7 @@ export function propertyParse(key, node, properties) {
* @param throwException
*/
export
function
getDataByPath
(
scope
,
path
,
throwException
?)
{
let
func
=
new
Function
(
'scope'
,
`return scope`
+
(
path
===
undefined
?
''
:
(
'.'
+
path
)
));
let
func
=
new
Function
(
'scope'
,
`return scope`
+
(
path
?
(
'.'
+
path
)
:
''
));
try
{
return
func
(
scope
);
}
catch
(
e
)
{
...
...
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