aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cli
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2018-12-09 04:41:54 +0100
committerRenaud G <renaud@rolisteam.org>2018-12-09 04:41:54 +0100
commitc4b9d5ff34b49715853b362376cf519408739954 (patch)
tree52654ce0e2badc527064bbaa419a8de1e104a0b5 /cli
parent934387b1219ee16ab38d5a2a7e2f6e87f46b9900 (diff)
downloadOneRoll-c4b9d5ff34b49715853b362376cf519408739954.tar.gz
OneRoll-c4b9d5ff34b49715853b362376cf519408739954.zip
Partial Fix #22 error with several kind of dice.
Diffstat (limited to 'cli')
-rw-r--r--cli/displaytoolbox.cpp8
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)
{