Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP15
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
OP15
Commits
29e1963b
Commit
29e1963b
authored
2 years ago
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对返回坐标进行保护
小于0返回0 大于1返回1 其他不变
parent
e9a2e097
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
OP15.js
assets/OP15/scene/OP15.js
+17
-3
No files found.
assets/OP15/scene/OP15.js
View file @
29e1963b
...
...
@@ -608,17 +608,31 @@ cc.Class({
}
this
.
_lastFingerPosition
=
{
pos
:{
x
:
p
.
x
,
y
:
p
.
y
x
:
this
.
boundedPostion
(
p
.
x
)
,
y
:
this
.
boundedPostion
(
p
.
y
)
},
dirty
:
true
}
this
.
debugPointer
(
p
.
x
,
p
.
y
)
this
.
debugPointer
(
this
.
boundedPostion
(
p
.
x
),
this
.
boundedPostion
(
p
.
y
)
)
}
}
this
.
isDebug
=
false
;
},
// 限定坐标值
boundedPostion
(
value
)
{
if
(
value
<
0
)
{
return
0
}
if
(
value
>
1
)
{
return
1
}
return
value
},
checkInRegion
(
r
)
{
if
(
!
this
.
_lastFingerPosition
&&
!
this
.
_lastFingerPosition
.
pos
)
{
return
null
;
...
...
This diff is collapsed.
Click to expand it.
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