Fix edge-case with titles

This commit is contained in:
goat 2021-05-27 20:58:55 +02:00
parent 0140d7fcf5
commit a1976a6092
No known key found for this signature in database
GPG key ID: F18F057873895461

View file

@ -266,7 +266,10 @@ class CardCreator {
ctx.textAlign = "center";
ctx.font = med;
ctx.fillStyle = primary;
if (data.Character.Title.Name !== undefined)
ctx.fillText(data.Character.Title.Name, 665, textTitleY);
ctx.font = small;
ctx.fillText(`${data.Character.Server} (${data.Character.DC})`, 665, textServerY);
@ -296,7 +299,7 @@ class CardCreator {
ctx.textAlign = "center";
// Chara Name
if (data.Character.Title.Name == null || data.Character.Title.Name == "") {
if (data.Character.Title === undefined || data.Character.Title.Name == null || data.Character.Title.Name == "") {
ctx.fillText(data.Character.Name, 665, textNameNoTitleY);
} else {
ctx.fillText(data.Character.Name, 665, textNameTitleY);