Commit 94b4ce15 authored by limingzhe's avatar limingzhe

fix: 修复标题点击区域异常

parent 3aa8995c
......@@ -823,31 +823,36 @@ export class PlayComponent implements OnInit, OnDestroy {
this.title1.x = -2 + this.t1Bg.width / 2;
this.title1.y = 1 + this.t1Bg.height / 2;
//大标题
let bgRect = new ShapeRect();
const bgRect = new ShapeRect();
bgRect.setSize(1000, 60);
bgRect.init();
bgRect.fillColor = '#ffdb84';
this.juziBg.addChild(bgRect);
bgRect.x = 37;
bgRect.y = -333;
// this.startBorder.addChild(bgRect, -1);
this.title2 = new Label();
this.title2.text = this.data.title.t_val2;
this.title2.fontName = 'FUTURAB';
this.title2.fontColor = '#040404';
this.title2.fontSize = 50 * this.t1Bg.scaleX;
this.title2.textAlign = 'left';
this.title2.refreshSize();
// bgRect.addChild(this.title2);
this.title2.setMaxSize(1000);
this.title2.x = this.t1Bg.x + (this.t1Bg.width + 10) * this.t1Bg.scaleX;
this.title2.y = this.t1Bg.y + (this.t1Bg.height / 2 + 6) * this.t1Bg.scaleY;
this.title2.refreshSize();
this.renderArr.push(this.title2);
this.renderArr.push(bgRect);
this.bgRect = bgRect;
}
refreshTitleBg() {
this.title2.refreshSize();
this.bgRect.width = this.title2.width * this.title2.scaleX;
this.bgRect.height = this.title2.height * this.title2.scaleY;
this.bgRect.x = this.title2.x + this.title2.width / 2;
this.bgRect.y = this.title2.y;
}
initBg() {
......@@ -981,6 +986,8 @@ export class PlayComponent implements OnInit, OnDestroy {
return;
}
this.refreshTitleBg();
if (this.checkClickTarget(this.bgRect)) {//标题音
this.pauseFullAudio();
this.pauseSentenceAudio();
......
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