Commit f79f863e authored by limingzhe's avatar limingzhe

fix: debug

parent 5edd4a04
...@@ -575,7 +575,6 @@ cc.Class({ ...@@ -575,7 +575,6 @@ cc.Class({
console.log(' this.photo end ', data); console.log(' this.photo end ', data);
this.debugDrawLayer.removeAllChildren();
const isRightArea = this.checkIsRightArea(data); const isRightArea = this.checkIsRightArea(data);
if (!isRightArea) { if (!isRightArea) {
...@@ -597,6 +596,16 @@ cc.Class({ ...@@ -597,6 +596,16 @@ cc.Class({
this.isCanDraw = false; this.isCanDraw = false;
}) })
this.debugDrawLayer.removeAllChildren();
const benchmark1Text = this.benchmark1Data.labelText
const benchmark1TextArr = benchmark1Text.split(' ');
const benchmark1LabelData = this.getPhotoLabelData(benchmark1TextArr, data?.result?.text);
const benchmark2Text = this.benchmark2Data.labelText
const benchmark2TextArr = benchmark2Text.split(' ');
const benchmark2LabelData = this.getPhotoLabelData(benchmark2TextArr, data?.result?.text);
const answerData = this.getAnswerData(data); const answerData = this.getAnswerData(data);
...@@ -643,7 +652,7 @@ cc.Class({ ...@@ -643,7 +652,7 @@ cc.Class({
console.log('benchmark1TextArr: ', benchmark1TextArr); console.log('benchmark1TextArr: ', benchmark1TextArr);
// const letter = this.data.letter || 'Aa'; // const letter = this.data.letter || 'Aa';
const benchmark1LabelData = this.getPhotoLabelData(benchmark1TextArr, text); const benchmark1LabelData = this.getPhotoLabelData(benchmark1TextArr, text, false);
if (!benchmark1LabelData) { if (!benchmark1LabelData) {
console.log('!benchmark1LabelData') console.log('!benchmark1LabelData')
return false; return false;
...@@ -657,7 +666,7 @@ cc.Class({ ...@@ -657,7 +666,7 @@ cc.Class({
const benchmark2Text = this.benchmark2Data.labelText const benchmark2Text = this.benchmark2Data.labelText
const benchmark2TextArr = benchmark2Text.split(' '); const benchmark2TextArr = benchmark2Text.split(' ');
const benchmark2LabelData = this.getPhotoLabelData(benchmark2TextArr, text); const benchmark2LabelData = this.getPhotoLabelData(benchmark2TextArr, text, false);
if (!benchmark2LabelData) { if (!benchmark2LabelData) {
return false; return false;
} }
...@@ -1049,7 +1058,7 @@ cc.Class({ ...@@ -1049,7 +1058,7 @@ cc.Class({
getPhotoLabelData(textArr, block) { getPhotoLabelData(textArr, block, isShow=true) {
for(let j=0; j<block.length; j++) { for(let j=0; j<block.length; j++) {
...@@ -1062,7 +1071,7 @@ cc.Class({ ...@@ -1062,7 +1071,7 @@ cc.Class({
const sentence = line.content; const sentence = line.content;
if (isShow) {
const label = this.getLabel(sentence, 150); const label = this.getLabel(sentence, 150);
label.x = line.left * this.debugBgImg.width; label.x = line.left * this.debugBgImg.width;
label.y = -(line.top + (line.bottom - line.top) / 2) * this.debugBgImg.height; label.y = -(line.top + (line.bottom - line.top) / 2) * this.debugBgImg.height;
...@@ -1072,6 +1081,8 @@ cc.Class({ ...@@ -1072,6 +1081,8 @@ cc.Class({
const l = label.getComponent(cc.Label); const l = label.getComponent(cc.Label);
label.anchorX = 0; label.anchorX = 0;
console.log(' sentence~: ', sentence); console.log(' sentence~: ', sentence);
}
...@@ -2222,7 +2233,7 @@ cc.Class({ ...@@ -2222,7 +2233,7 @@ cc.Class({
"top":0.0971250981092453, "top":0.0971250981092453,
"bottom":0.12354312092065811, "bottom":0.12354312092065811,
"score":1, "score":1,
"content":"Trace,write,and say." "content":"CTrace,write,and say."
}, },
{ {
"left":0.14084507524967194, "left":0.14084507524967194,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment