Reworking the squares size

preferencesAboutTextFull
shibakaneki 12 years ago
parent d58dafa125
commit d740a60abc
  1. 5
      src/board/UBBoardController.cpp
  2. 1
      src/frameworks/UBGeometryUtils.cpp
  3. 1
      src/frameworks/UBGeometryUtils.h
  4. 2
      src/tools/UBAbstractDrawRuler.cpp

@ -109,7 +109,10 @@ UBBoardController::UBBoardController(UBMainWindow* mainWindow)
mMarkerColorOnDarkBackground = UBSettings::settings()->markerColors(true).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;
const int UBGeometryUtils::millimeterGraduationHeight = 5;
const int UBGeometryUtils::millimetersPerCentimeter = 10;
const int UBGeometryUtils::millimetersPerHalfCentimeter = 5;
const float UBGeometryUtils::inchSize = 25.4f;
UBGeometryUtils::UBGeometryUtils()
{

@ -43,6 +43,7 @@ class UBGeometryUtils
const static int millimeterGraduationHeight;
const static int millimetersPerCentimeter;
const static int millimetersPerHalfCentimeter;
const static float inchSize;
};
#endif /* UBGEOMETRYUTILS_H_ */

@ -47,7 +47,7 @@ UBAbstractDrawRuler::UBAbstractDrawRuler()
//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
sPixelsPerMillimeter = qRound(dpiCommon / UBGeometryUtils::inchSize);
}

Loading…
Cancel
Save