fix text render flickering

This commit is contained in:
2020-06-13 18:07:09 +02:00
parent 835ffa9e8e
commit 55200dc742
2 changed files with 4 additions and 4 deletions

View File

@@ -107,8 +107,6 @@ export class TextRenderingService {
const chordCount = chords.reduce((acc: number, cur: Chord) => acc + cur.length, 0); const chordCount = chords.reduce((acc: number, cur: Chord) => acc + cur.length, 0);
const lineCount = chordLine.replace(/\s/g, "").length; const lineCount = chordLine.replace(/\s/g, "").length;
console.log(chordCount + ' - ' + lineCount + ' - ' + chordLine);
console.log(chords);
const isChrod = chordCount * 2 > lineCount; const isChrod = chordCount * 2 > lineCount;
return isChrod ? chords : []; return isChrod ? chords : [];
} }

View File

@@ -43,8 +43,10 @@ export class SongTextComponent implements OnInit {
public set text(value: string) { public set text(value: string) {
this.sections = null; this.sections = null;
this.offset = 0; this.offset = 0;
setTimeout(() => if (this.fullscreen)
this.sections = this.textRenderingService.parse(value, this.transpose).sort((a, b) => a.type - b.type), 100); setTimeout(() =>
this.sections = this.textRenderingService.parse(value, this.transpose).sort((a, b) => a.type - b.type), 100);
else this.sections = this.textRenderingService.parse(value, this.transpose).sort((a, b) => a.type - b.type)
} }