Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cc_mz_write_02
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
cc_mz_write_02
Commits
2eb8e01a
Commit
2eb8e01a
authored
Nov 03, 2022
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: debug
parent
45f6a2ee
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
34 deletions
+24
-34
cc_mz_write_02.js
assets/cc_mz_write_02/scene/cc_mz_write_02.js
+24
-34
No files found.
assets/cc_mz_write_02/scene/cc_mz_write_02.js
View file @
2eb8e01a
...
@@ -832,7 +832,7 @@ cc.Class({
...
@@ -832,7 +832,7 @@ cc.Class({
// "is_line_link": false,
// "is_line_link": false,
"
write_regions
"
:
writeRegions
,
"
write_regions
"
:
writeRegions
,
"
circle_regions
"
:
circleRegions
,
"
circle_regions
"
:
circleRegions
,
"
line_regions
"
:
lineRegion
s
,
"
line_regions
"
:
newPoint
s
,
}
}
...
@@ -988,7 +988,7 @@ cc.Class({
...
@@ -988,7 +988,7 @@ cc.Class({
return
;
return
;
}
}
return
;
const
answerData
=
{};
const
answerData
=
{};
...
@@ -996,43 +996,31 @@ cc.Class({
...
@@ -996,43 +996,31 @@ cc.Class({
const
oneTextData
=
textArr
[
i
];
const
oneTextData
=
textArr
[
i
];
const
points
=
oneTextData
.
points
;
const
points
=
oneTextData
.
points
;
const
tempDisNum
=
Math
.
floor
(
points
.
length
/
3
);
const
point1_x
=
points
[
0
];
const
point1_x
=
points
[
0
];
const
point1_y
=
points
[
1
];
const
point1_y
=
points
[
1
];
const
point2_x
=
points
[
tempDisNum
];
const
point2_x
=
points
[
2
];
const
point2_y
=
points
[
tempDisNum
+
1
];
const
point2_y
=
points
[
3
];
const
point3_x
=
points
[
tempDisNum
*
2
];
const
point3_y
=
points
[
tempDisNum
*
2
+
1
];
let
centerP
=
this
.
locate
(
point1_x
,
point1_y
,
point2_x
,
point2_y
,
point3_x
,
point3_y
);
console
.
log
(
"
~~centerP:
"
,
centerP
)
for
(
let
j
=
0
;
j
<
points
.
length
;
j
+=
2
)
{
const
x
=
points
[
j
]
//centerP.x
const
y
=
-
points
[
j
+
1
]
//-centerP.y
const
w
=
0.01
;
const
h
=
0.01
;
const
rect
=
{
const
rect1
=
{
x
,
y
,
x
:
point1_x
,
width
:
w
,
y
:
-
point1_y
,
height
:
h
width
:
0.01
,
height
:
0.01
}
}
console
.
log
(
'
oneTextData:
'
,
oneTextData
);
const
colorRect1
=
this
.
getColorDot
(
rect1
.
x
,
rect1
.
y
,
rect1
.
width
,
rect1
.
height
,
"
purple
"
);
this
.
debugDrawLayer
.
addChild
(
colorRect1
,
1
);
const
colorRect
=
this
.
getColorDot
(
rect
.
x
,
rect
.
y
,
w
,
h
,
"
red
"
);
this
.
debugDrawLayer
.
addChild
(
colorRect
,
1
);
this
.
setCirclePosInRectArr
(
colorRect
);
const
rect2
=
{
x
:
point2_x
,
y
:
-
point2_y
,
width
:
0.01
,
height
:
0.01
}
}
const
colorRect2
=
this
.
getColorDot
(
rect2
.
x
,
rect2
.
y
,
rect1
.
width
,
rect1
.
height
,
"
purple
"
);
this
.
debugDrawLayer
.
addChild
(
colorRect2
,
1
);
}
}
},
},
...
@@ -3354,7 +3342,9 @@ cc.Class({
...
@@ -3354,7 +3342,9 @@ cc.Class({
getPhotoData
(
cb
)
{
getPhotoData
(
cb
)
{
const
tmpData1
=
{
"
result
"
:{
"
text
"
:[{
"
type
"
:
1
,
"
points
"
:[
0.23666666
,
0.45360824
,
0.24
,
0.45360824
,
0.22
,
0.45618558
,
0.22333333
,
0.45618558
,
0.22666667
,
0.45618558
,
0.23
,
0.45618558
,
0.23333333
,
0.45618558
,
0.24333334
,
0.45618558
,
0.24666667
,
0.45618558
,
0.25
,
0.45618558
,
0.25333333
,
0.45618558
,
0.25666666
,
0.45618558
,
0.26
,
0.45618558
,
0.20666666
,
0.45876288
,
0.21
,
0.45876288
,
0.21333334
,
0.45876288
,
0.21666667
,
0.45876288
,
0.26333332
,
0.45876288
,
0.26666668
,
0.45876288
,
0.27
,
0.45876288
,
0.27333334
,
0.45876288
,
0.19666667
,
0.46134022
,
0.2
,
0.46134022
,
0.20333333
,
0.46134022
,
0.27666667
,
0.46134022
,
0.28
,
0.46134022
,
0.28333333
,
0.46134022
,
0.17666666
,
0.46391752
,
0.18
,
0.46391752
,
0.18333334
,
0.46391752
,
0.18666667
,
0.46391752
,
0.19
,
0.46391752
,
0.19333333
,
0.46391752
,
0.28666666
,
0.46391752
,
0.29
,
0.46391752
,
0.29333332
,
0.46391752
,
0.29666665
,
0.46391752
,
0.3
,
0.46391752
,
0.30333334
,
0.46391752
,
0.30666667
,
0.46391752
,
0.31
,
0.46391752
,
0.31333333
,
0.46391752
,
0.31666666
,
0.46391752
,
0.32
,
0.46391752
,
0.32333332
,
0.46391752
,
0.32666665
,
0.46391752
,
0.17
,
0.46649486
,
0.17333333
,
0.46649486
,
0.28666666
,
0.46649486
,
0.33
,
0.46649486
,
0.33333334
,
0.46649486
,
0.33666667
,
0.46649486
,
0.34
,
0.46649486
,
0.34333333
,
0.46649486
,
0.34666666
,
0.46649486
,
0.35
,
0.46649486
,
0.35333332
,
0.46649486
,
0.35666665
,
0.46649486
,
0.36
,
0.46649486
,
0.36333334
,
0.46649486
,
0.36666667
,
0.46649486
,
0.37
,
0.46649486
,
0.16666667
,
0.46907216
,
0.28666666
,
0.46907216
,
0.16333333
,
0.4716495
,
0.28666666
,
0.4716495
,
0.16333333
,
0.4742268
,
0.28666666
,
0.4742268
,
0.16333333
,
0.47680414
,
0.28666666
,
0.47680414
,
0.16
,
0.47938144
,
0.28666666
,
0.47938144
,
0.16
,
0.48195878
,
0.28666666
,
0.48195878
,
0.16
,
0.48453608
,
0.28666666
,
0.48453608
,
0.16
,
0.48711342
,
0.29
,
0.48711342
,
0.15666667
,
0.48969072
,
0.29
,
0.48969072
,
0.15333334
,
0.49226806
,
0.29
,
0.49226806
,
0.15333334
,
0.49484536
,
0.29
,
0.49484536
,
0.15333334
,
0.4974227
,
0.29
,
0.4974227
,
0.15
,
0.5
,
0.29
,
0.5
,
0.15
,
0.5025773
,
0.29
,
0.5025773
,
0.15
,
0.5051546
,
0.29
,
0.5051546
,
0.15
,
0.507732
,
0.28666666
,
0.507732
,
0.15
,
0.5103093
,
0.28666666
,
0.5103093
,
0.15
,
0.5128866
,
0.28666666
,
0.5128866
,
0.15
,
0.5154639
,
0.28666666
,
0.5154639
,
0.15
,
0.51804125
,
0.28666666
,
0.51804125
,
0.15
,
0.52061856
,
0.28666666
,
0.52061856
,
0.15
,
0.52319586
,
0.28333333
,
0.52319586
,
0.15333334
,
0.52577317
,
0.28333333
,
0.52577317
,
0.15333334
,
0.52835053
,
0.28
,
0.52835053
,
0.15333334
,
0.53092784
,
0.27666667
,
0.53092784
,
0.15333334
,
0.53350514
,
0.27333334
,
0.53350514
,
0.15333334
,
0.53608245
,
0.26666668
,
0.53608245
,
0.27
,
0.53608245
,
0.15333334
,
0.5386598
,
0.25666666
,
0.5386598
,
0.26
,
0.5386598
,
0.26333332
,
0.5386598
,
0.15666667
,
0.5412371
,
0.25
,
0.5412371
,
0.25333333
,
0.5412371
,
0.15666667
,
0.5438144
,
0.24333334
,
0.5438144
,
0.24666667
,
0.5438144
,
0.15666667
,
0.5463917
,
0.23333333
,
0.5463917
,
0.23666666
,
0.5463917
,
0.24
,
0.5463917
,
0.16
,
0.5489691
,
0.23
,
0.5489691
,
0.16333333
,
0.5515464
,
0.22333333
,
0.5515464
,
0.22666667
,
0.5515464
,
0.16666667
,
0.5541237
,
0.17
,
0.5541237
,
0.17333333
,
0.5541237
,
0.17666666
,
0.5541237
,
0.18
,
0.5541237
,
0.18333334
,
0.5541237
,
0.18666667
,
0.5541237
,
0.19
,
0.5541237
,
0.19333333
,
0.5541237
,
0.19666667
,
0.5541237
,
0.2
,
0.5541237
,
0.20333333
,
0.5541237
,
0.20666666
,
0.5541237
,
0.21
,
0.5541237
,
0.21333334
,
0.5541237
,
0.21666667
,
0.5541237
,
0.22
,
0.5541237
]}]}}
const
tmpData1
=
{
"
result
"
:{
"
text
"
:[{
"
type
"
:
0
,
"
points
"
:[
0.2
,
0.49
,
0.43
,
0.56
]}]}};
// const tmpData1 = {"result":{"text":[{"type":1,"points":[0.23666666,0.45360824,0.24,0.45360824,0.22,0.45618558,0.22333333,0.45618558,0.22666667,0.45618558,0.23,0.45618558,0.23333333,0.45618558,0.24333334,0.45618558,0.24666667,0.45618558,0.25,0.45618558,0.25333333,0.45618558,0.25666666,0.45618558,0.26,0.45618558,0.20666666,0.45876288,0.21,0.45876288,0.21333334,0.45876288,0.21666667,0.45876288,0.26333332,0.45876288,0.26666668,0.45876288,0.27,0.45876288,0.27333334,0.45876288,0.19666667,0.46134022,0.2,0.46134022,0.20333333,0.46134022,0.27666667,0.46134022,0.28,0.46134022,0.28333333,0.46134022,0.17666666,0.46391752,0.18,0.46391752,0.18333334,0.46391752,0.18666667,0.46391752,0.19,0.46391752,0.19333333,0.46391752,0.28666666,0.46391752,0.29,0.46391752,0.29333332,0.46391752,0.29666665,0.46391752,0.3,0.46391752,0.30333334,0.46391752,0.30666667,0.46391752,0.31,0.46391752,0.31333333,0.46391752,0.31666666,0.46391752,0.32,0.46391752,0.32333332,0.46391752,0.32666665,0.46391752,0.17,0.46649486,0.17333333,0.46649486,0.28666666,0.46649486,0.33,0.46649486,0.33333334,0.46649486,0.33666667,0.46649486,0.34,0.46649486,0.34333333,0.46649486,0.34666666,0.46649486,0.35,0.46649486,0.35333332,0.46649486,0.35666665,0.46649486,0.36,0.46649486,0.36333334,0.46649486,0.36666667,0.46649486,0.37,0.46649486,0.16666667,0.46907216,0.28666666,0.46907216,0.16333333,0.4716495,0.28666666,0.4716495,0.16333333,0.4742268,0.28666666,0.4742268,0.16333333,0.47680414,0.28666666,0.47680414,0.16,0.47938144,0.28666666,0.47938144,0.16,0.48195878,0.28666666,0.48195878,0.16,0.48453608,0.28666666,0.48453608,0.16,0.48711342,0.29,0.48711342,0.15666667,0.48969072,0.29,0.48969072,0.15333334,0.49226806,0.29,0.49226806,0.15333334,0.49484536,0.29,0.49484536,0.15333334,0.4974227,0.29,0.4974227,0.15,0.5,0.29,0.5,0.15,0.5025773,0.29,0.5025773,0.15,0.5051546,0.29,0.5051546,0.15,0.507732,0.28666666,0.507732,0.15,0.5103093,0.28666666,0.5103093,0.15,0.5128866,0.28666666,0.5128866,0.15,0.5154639,0.28666666,0.5154639,0.15,0.51804125,0.28666666,0.51804125,0.15,0.52061856,0.28666666,0.52061856,0.15,0.52319586,0.28333333,0.52319586,0.15333334,0.52577317,0.28333333,0.52577317,0.15333334,0.52835053,0.28,0.52835053,0.15333334,0.53092784,0.27666667,0.53092784,0.15333334,0.53350514,0.27333334,0.53350514,0.15333334,0.53608245,0.26666668,0.53608245,0.27,0.53608245,0.15333334,0.5386598,0.25666666,0.5386598,0.26,0.5386598,0.26333332,0.5386598,0.15666667,0.5412371,0.25,0.5412371,0.25333333,0.5412371,0.15666667,0.5438144,0.24333334,0.5438144,0.24666667,0.5438144,0.15666667,0.5463917,0.23333333,0.5463917,0.23666666,0.5463917,0.24,0.5463917,0.16,0.5489691,0.23,0.5489691,0.16333333,0.5515464,0.22333333,0.5515464,0.22666667,0.5515464,0.16666667,0.5541237,0.17,0.5541237,0.17333333,0.5541237,0.17666666,0.5541237,0.18,0.5541237,0.18333334,0.5541237,0.18666667,0.5541237,0.19,0.5541237,0.19333333,0.5541237,0.19666667,0.5541237,0.2,0.5541237,0.20333333,0.5541237,0.20666666,0.5541237,0.21,0.5541237,0.21333334,0.5541237,0.21666667,0.5541237,0.22,0.5541237]}]}}
// const tmpData1 = {"result":{"text":[{"left":0.22833333909511566,"right":0.3166666626930237,"top":0.5590206384658813,"bottom":0.628608226776123,"score":0.8552894592285156,"content":"Aa"},{"left":0.6816666126251221,"right":0.7666666507720947,"top":0.42257729172706604,"bottom":0.49860823154449463,"score":0.8148108720779419,"content":"Aa"},{"left":0.6983333230018616,"right":0.7666666507720947,"top":0.5564433336257935,"bottom":0.628608226776123,"score":0.7532452344894409,"content":"Aa"}]}}
// const tmpData1 = {"result":{"text":[{"left":0.22833333909511566,"right":0.3166666626930237,"top":0.5590206384658813,"bottom":0.628608226776123,"score":0.8552894592285156,"content":"Aa"},{"left":0.6816666126251221,"right":0.7666666507720947,"top":0.42257729172706604,"bottom":0.49860823154449463,"score":0.8148108720779419,"content":"Aa"},{"left":0.6983333230018616,"right":0.7666666507720947,"top":0.5564433336257935,"bottom":0.628608226776123,"score":0.7532452344894409,"content":"Aa"}]}}
// const tmpData1 = {"result":{"text":[{"left":0.09814612567424774,"right":0.4471101462841034,"top":0.006644518114626408,"bottom":0.15614618360996246,"score":1,"content":"CTrace,write,and say."},{"left":0.10796073824167252,"right":0.5049073100090027,"top":0.1827242523431778,"bottom":0.4518272280693054,"score":0.9702169299125671,"content":"AAAA"},{"left":0.5834242105484009,"right":0.659760057926178,"top":0.17607973515987396,"bottom":0.4485049843788147,"score":0.9523985981941223,"content":"A"},{"left":0.6706652045249939,"right":0.8298800587654114,"top":0.15614618360996246,"bottom":0.43853819370269775,"score":0.9089533090591431,"content":"A"},{"left":0.5866957306861877,"right":0.6521264910697937,"top":0.634551465511322,"bottom":0.8504983186721802,"score":0.8326067328453064,"content":"a"},{"left":0.7699018716812134,"right":0.8276990056037903,"top":0.6411960124969482,"bottom":0.8039867281913757,"score":0.8035371899604797,"content":"a"}]}}
// const tmpData1 = {"result":{"text":[{"left":0.09814612567424774,"right":0.4471101462841034,"top":0.006644518114626408,"bottom":0.15614618360996246,"score":1,"content":"CTrace,write,and say."},{"left":0.10796073824167252,"right":0.5049073100090027,"top":0.1827242523431778,"bottom":0.4518272280693054,"score":0.9702169299125671,"content":"AAAA"},{"left":0.5834242105484009,"right":0.659760057926178,"top":0.17607973515987396,"bottom":0.4485049843788147,"score":0.9523985981941223,"content":"A"},{"left":0.6706652045249939,"right":0.8298800587654114,"top":0.15614618360996246,"bottom":0.43853819370269775,"score":0.9089533090591431,"content":"A"},{"left":0.5866957306861877,"right":0.6521264910697937,"top":0.634551465511322,"bottom":0.8504983186721802,"score":0.8326067328453064,"content":"a"},{"left":0.7699018716812134,"right":0.8276990056037903,"top":0.6411960124969482,"bottom":0.8039867281913757,"score":0.8035371899604797,"content":"a"}]}}
cb
(
tmpData1
);
cb
(
tmpData1
);
...
...
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