fix text render flickering
This commit is contained in:
@@ -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 : [];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user