Commit f79f863e authored by limingzhe's avatar limingzhe

fix: debug

parent 5edd4a04
......@@ -575,7 +575,6 @@ cc.Class({
console.log(' this.photo end ', data);
this.debugDrawLayer.removeAllChildren();
const isRightArea = this.checkIsRightArea(data);
if (!isRightArea) {
......@@ -597,6 +596,16 @@ cc.Class({
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);
......@@ -643,7 +652,7 @@ cc.Class({
console.log('benchmark1TextArr: ', benchmark1TextArr);
// const letter = this.data.letter || 'Aa';
const benchmark1LabelData = this.getPhotoLabelData(benchmark1TextArr, text);
const benchmark1LabelData = this.getPhotoLabelData(benchmark1TextArr, text, false);
if (!benchmark1LabelData) {
console.log('!benchmark1LabelData')
return false;
......@@ -657,7 +666,7 @@ cc.Class({
const benchmark2Text = this.benchmark2Data.labelText
const benchmark2TextArr = benchmark2Text.split(' ');
const benchmark2LabelData = this.getPhotoLabelData(benchmark2TextArr, text);
const benchmark2LabelData = this.getPhotoLabelData(benchmark2TextArr, text, false);
if (!benchmark2LabelData) {
return false;
}
......@@ -1049,7 +1058,7 @@ cc.Class({
getPhotoLabelData(textArr, block) {
getPhotoLabelData(textArr, block, isShow=true) {
for(let j=0; j<block.length; j++) {
......@@ -1062,16 +1071,18 @@ cc.Class({
const sentence = line.content;
if (isShow) {
const label = this.getLabel(sentence, 150);
label.x = line.left * this.debugBgImg.width;
label.y = -(line.top + (line.bottom - line.top) / 2) * this.debugBgImg.height;
label.parent = this.debugDrawLayer;
label.zIndex = 200;
// label.color = cc.Color.RED;
const l = label.getComponent(cc.Label);
label.anchorX = 0;
console.log(' sentence~: ', sentence);
}
const label = this.getLabel(sentence, 150);
label.x = line.left * this.debugBgImg.width;
label.y = -(line.top + (line.bottom - line.top) / 2) * this.debugBgImg.height;
label.parent = this.debugDrawLayer;
label.zIndex = 200;
// label.color = cc.Color.RED;
const l = label.getComponent(cc.Label);
label.anchorX = 0;
console.log(' sentence~: ', sentence);
......@@ -2222,7 +2233,7 @@ cc.Class({
"top":0.0971250981092453,
"bottom":0.12354312092065811,
"score":1,
"content":"Trace,write,and say."
"content":"CTrace,write,and say."
},
{
"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