diff options
| author | 2018-12-09 04:41:54 +0100 | |
|---|---|---|
| committer | 2018-12-09 04:41:54 +0100 | |
| commit | c4b9d5ff34b49715853b362376cf519408739954 (patch) | |
| tree | 52654ce0e2badc527064bbaa419a8de1e104a0b5 /cli | |
| parent | 934387b1219ee16ab38d5a2a7e2f6e87f46b9900 (diff) | |
| download | OneRoll-c4b9d5ff34b49715853b362376cf519408739954.tar.gz OneRoll-c4b9d5ff34b49715853b362376cf519408739954.zip | |
Partial Fix #22 error with several kind of dice.
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/displaytoolbox.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/displaytoolbox.cpp b/cli/displaytoolbox.cpp index 3ecc713..f477274 100644 --- a/cli/displaytoolbox.cpp +++ b/cli/displaytoolbox.cpp @@ -131,7 +131,7 @@ QString DisplayToolBox::makeImage(QString scalarText, QString resultStr,QJsonArr { result.append(diceResultToString(valRef.toObject())); } - text =QStringLiteral("d%1:(").arg(obj["face"].toDouble()); + text =QStringLiteral("d%1:(").arg(obj["face"].toInt()); painter.drawText(QPoint(x,y),text); x += fm.boundingRect(text).width(); @@ -259,7 +259,7 @@ QString DisplayToolBox::diceToSvg(QJsonArray array,bool withColor,bool allSameCo { subResult.append(diceResultToString(valRef.toObject())); } - result.append(QStringLiteral("d%1:(").arg(obj["face"].toString())); + result.append(QStringLiteral("d%1:(").arg(obj["face"].toInt())); if(withColor) { result.append(QStringLiteral("<tspan fill=\"%1\">").arg(obj["color"].toString())); @@ -366,7 +366,7 @@ QString DisplayToolBox::diceToText(QJsonArray array, bool withColor,bool allSame QStringList result; for(auto item : array) { - QString subResult; + QString subResult(""); auto obj = item.toObject(); auto values= obj["values"].toArray(); @@ -379,7 +379,7 @@ QString DisplayToolBox::diceToText(QJsonArray array, bool withColor,bool allSame { if(!allSameFaceCount) { - subResult += QStringLiteral("d%1:(").arg(obj["face"].toString()); + subResult += QStringLiteral("d%1:(").arg(obj["face"].toInt()); } if(withColor) { |