Commit fb56485c authored by Anatoly Mihalchenko's avatar Anatoly Mihalchenko

Sankore 378

parent cef6e1a8
......@@ -35,7 +35,6 @@ const QColor UBAbstractDrawRuler::sDarkBackgroundDrawColor = QColor(0xff, 0xff,
const int UBAbstractDrawRuler::sLeftEdgeMargin = 10;
const int UBAbstractDrawRuler::sDegreeToQtAngleUnit = 16;
const int UBAbstractDrawRuler::sRotationRadius = 15;
const int UBAbstractDrawRuler::sPixelsPerMillimeter = 5;
const int UBAbstractDrawRuler::sFillTransparency = 127;
const int UBAbstractDrawRuler::sDrawTransparency = 192;
const int UBAbstractDrawRuler::sRoundingRadius = sLeftEdgeMargin / 2;
......@@ -44,7 +43,12 @@ const int UBAbstractDrawRuler::sRoundingRadius = sLeftEdgeMargin / 2;
UBAbstractDrawRuler::UBAbstractDrawRuler()
: mShowButtons(false)
, mAntiScaleRatio(1.0)
{}
{
//we actually need to evaluate pixels per millimeter
QDesktopWidget* desktop = UBApplication::desktop();
int dpiCommon = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2;
sPixelsPerMillimeter = qRound(dpiCommon / 25.4f);//because 1inch = 25.4 mm
}
void UBAbstractDrawRuler::create(QGraphicsItem& item)
{
......
......@@ -70,14 +70,13 @@ protected:
static const QColor sDarkBackgroundMiddleFillColor;
static const QColor sDarkBackgroundDrawColor;
static const int sLeftEdgeMargin;
static const int sDegreeToQtAngleUnit;
static const int sRotationRadius;
static const int sPixelsPerMillimeter;
static const int sFillTransparency;
static const int sDrawTransparency;
static const int sRoundingRadius;
static const int sLeftEdgeMargin;
static const int sDegreeToQtAngleUnit;
static const int sRotationRadius;
static const int sFillTransparency;
static const int sDrawTransparency;
static const int sRoundingRadius;
int sPixelsPerMillimeter;
};
#endif
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