Commit d740a60a authored by shibakaneki's avatar shibakaneki

Reworking the squares size

parent d58dafa1
...@@ -109,7 +109,10 @@ UBBoardController::UBBoardController(UBMainWindow* mainWindow) ...@@ -109,7 +109,10 @@ UBBoardController::UBBoardController(UBMainWindow* mainWindow)
mMarkerColorOnDarkBackground = UBSettings::settings()->markerColors(true).at(markerColorIndex); mMarkerColorOnDarkBackground = UBSettings::settings()->markerColors(true).at(markerColorIndex);
mMarkerColorOnLightBackground = UBSettings::settings()->markerColors(false).at(markerColorIndex); mMarkerColorOnLightBackground = UBSettings::settings()->markerColors(false).at(markerColorIndex);
UBSettings::settings()->crossSize = UBGeometryUtils::millimetersPerCentimeter * 4; QDesktopWidget* desktop = UBApplication::desktop();
int dpiCommon = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2;
int sPixelsPerMillimeter = qRound(dpiCommon / UBGeometryUtils::inchSize);
UBSettings::settings()->crossSize = 10*sPixelsPerMillimeter;
} }
......
...@@ -23,6 +23,7 @@ const int UBGeometryUtils::halfCentimeterGraduationHeight = 10; ...@@ -23,6 +23,7 @@ const int UBGeometryUtils::halfCentimeterGraduationHeight = 10;
const int UBGeometryUtils::millimeterGraduationHeight = 5; const int UBGeometryUtils::millimeterGraduationHeight = 5;
const int UBGeometryUtils::millimetersPerCentimeter = 10; const int UBGeometryUtils::millimetersPerCentimeter = 10;
const int UBGeometryUtils::millimetersPerHalfCentimeter = 5; const int UBGeometryUtils::millimetersPerHalfCentimeter = 5;
const float UBGeometryUtils::inchSize = 25.4f;
UBGeometryUtils::UBGeometryUtils() UBGeometryUtils::UBGeometryUtils()
{ {
......
...@@ -43,6 +43,7 @@ class UBGeometryUtils ...@@ -43,6 +43,7 @@ class UBGeometryUtils
const static int millimeterGraduationHeight; const static int millimeterGraduationHeight;
const static int millimetersPerCentimeter; const static int millimetersPerCentimeter;
const static int millimetersPerHalfCentimeter; const static int millimetersPerHalfCentimeter;
const static float inchSize;
}; };
#endif /* UBGEOMETRYUTILS_H_ */ #endif /* UBGEOMETRYUTILS_H_ */
...@@ -47,7 +47,7 @@ UBAbstractDrawRuler::UBAbstractDrawRuler() ...@@ -47,7 +47,7 @@ UBAbstractDrawRuler::UBAbstractDrawRuler()
//we actually need to evaluate pixels per millimeter //we actually need to evaluate pixels per millimeter
QDesktopWidget* desktop = UBApplication::desktop(); QDesktopWidget* desktop = UBApplication::desktop();
int dpiCommon = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2; int dpiCommon = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2;
sPixelsPerMillimeter = qRound(dpiCommon / 25.4f);//because 1inch = 25.4 mm sPixelsPerMillimeter = qRound(dpiCommon / UBGeometryUtils::inchSize);
} }
......
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