Commit d5b5ecee authored by Aleksi Suomalainen's avatar Aleksi Suomalainen Committed by GitHub

Merge pull request #44 from neochapay/master

Add function to set custom mm and dp scale factor
parents e239b429 d27167f1
......@@ -105,3 +105,26 @@ float Sizing::dp(float value)
{
return value*m_dp_factor;
}
void Sizing::setMmScaleFactor(float value)
{
if(value != 0)
{
qDebug() << "Set custom mm scale factor";
m_p_width = value;
setMmScaleFactor();
}
}
void Sizing::setDpScaleFactor(float value)
{
if(value != 0)
{
qDebug() << "Set custom dp scale factor";
m_dp_factor = value;
}
}
......@@ -37,6 +37,9 @@ public:
Q_INVOKABLE float mm(float value);
Q_INVOKABLE float dp(float value);
Q_INVOKABLE void setMmScaleFactor(float value);
Q_INVOKABLE void setDpScaleFactor(float value);
private:
bool m_valid;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment