Commit 74603626 authored by Chen Jiping's avatar Chen Jiping

修复bug

parent 4a57f417
...@@ -558,12 +558,24 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -558,12 +558,24 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
getDefaultWordArr() { getDefaultWordArr() {
let arr = []; let arr = [{
word_val: "example",
word_audio_url: "",
word_font_size:110,
letters:[{
letter_val:"example",
letter_audio_url:"",
letter_color:"C04"
}]
}];
return arr; return arr;
} }
getDefaultTitleArr() { getDefaultTitleArr() {
let arr = []; let arr = [{
title_val:"ple",
title_audio_url:""
}];
return arr; return arr;
} }
...@@ -686,8 +698,13 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -686,8 +698,13 @@ export class PlayComponent implements OnInit, OnDestroy {
this.lesson_bg = lesson_bg; this.lesson_bg = lesson_bg;
//课程信息 //课程信息
let lessonText = "Lesson ";
if(this.data.lesson_val){
lessonText += this.data.lesson_val;
}
const lesson = new Label(); const lesson = new Label();
lesson.text = "Lesson " + this.data.lesson_val; lesson.text = lessonText;
lesson.textAlign = 'center'; lesson.textAlign = 'center';
lesson.fontSize = 40; lesson.fontSize = 40;
lesson.fontName = 'BRLNSDB'; lesson.fontName = 'BRLNSDB';
...@@ -975,7 +992,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -975,7 +992,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// 每行显示n个单词 // 每行显示n个单词
else if(index % cols == 0){ else if(index % cols == 0){
//每一行最后一个单词,高度起始坐标增加 //每一行最后一个单词,高度起始坐标增加
startY += this.interval_height; startY += word_spreat.height + this.interval_height;
//下一行X坐标复原 //下一行X坐标复原
row_startX = startX; row_startX = startX;
...@@ -1038,8 +1055,14 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1038,8 +1055,14 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
} }
let title_bg_width = this.title_bg.width; let title_bg_width = this.title_bg.width;
//如果为空,则设置默认宽度
if(this.data.titleArr.length == 0){
title_bg_width = 218;
}
if(totalWidth >= this.title_bg.width){ if(totalWidth >= this.title_bg.width){
title_bg_width = totalWidth + 100; title_bg_width = totalWidth + 100;
......
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