Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP_18
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
OP_18
Commits
938b7318
Commit
938b7318
authored
Feb 07, 2023
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: debug
parent
b9c88b34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
1 deletion
+49
-1
.DS_Store
.DS_Store
+0
-0
OP_18.js
assets/OP_18/scene/OP_18.js
+49
-1
No files found.
.DS_Store
View file @
938b7318
No preview for this file type
assets/OP_18/scene/OP_18.js
View file @
938b7318
...
...
@@ -632,6 +632,49 @@ cc.Class({
},
getRegionByRect
(
regionRect
,
bgRect
)
{
const
left
=
Math
.
round
(
(
regionRect
.
x
)
/
bgRect
.
width
*
1000
)
/
1000
;
const
right
=
Math
.
round
(
(
regionRect
.
x
+
regionRect
.
width
)
/
bgRect
.
width
*
1000
)
/
1000
;
const
top
=
Math
.
round
(
(
regionRect
.
y
)
/
bgRect
.
height
*
1000
)
/
1000
;
const
bottom
=
Math
.
round
(
(
regionRect
.
y
+
regionRect
.
height
)
/
bgRect
.
height
*
1000
)
/
1000
;
return
{
left
,
top
,
right
,
bottom
};
},
getGroupArrByGIdx
(
arr
,
gIdx
)
{
const
groupArr
=
[];
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
if
(
arr
[
i
].
gIdx
==
gIdx
)
{
const
data
=
JSON
.
parse
(
JSON
.
stringify
(
arr
[
i
]));
groupArr
.
push
(
data
);
}
}
return
groupArr
;
},
getRegionsByGidx
(
gIdx
)
{
const
arr
=
this
.
getGroupArrByGIdx
(
this
.
data
.
hotZoneItemArr2
,
gIdx
);
const
bgRect
=
this
.
data
.
bgItem2
.
rect
;
console
.
log
(
"
arr:
"
,
arr
);
const
newLocationArr
=
[];
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
const
hzItem
=
arr
[
i
];
const
regionRect
=
hzItem
.
rect
;
let
region
=
this
.
getRegionByRect
(
regionRect
,
bgRect
);
newLocationArr
.
push
(
region
)
}
return
newLocationArr
;
},
//调起检测
startTesting
()
{
...
...
@@ -653,6 +696,10 @@ cc.Class({
// return;
const
partRegions
=
this
.
getRegionsByGidx
(
'
2
'
);
console
.
log
(
'
partRegions:
'
,
partRegions
);
const
cw
=
window
.
courseware
;
if
(
!
cw
||
!
cw
.
openOsmoHandwriting
)
{
...
...
@@ -671,7 +718,8 @@ cc.Class({
"
part_name
"
:
this
.
data
.
part_name
,
//"d",
"
is_hand_writing
"
:
true
,
"
is_line_link
"
:
false
,
"
write_regions
"
:
[
this
.
ques_region_opt
],
// "write_regions": [this.ques_region_opt],
"
write_regions
"
:
[
partRegions
],
lineType
,
circleSize
...
...
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