Merge pull request #40 from xsacha/master

Small adjustments for Blackberry/Symbian
This commit is contained in:
Henrik Rydgård
2013-01-30 23:52:03 -08:00
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -368,8 +368,8 @@ int main(int argc, char *argv[]) {
screen_get_display_property_iv(screen_disp, SCREEN_PROPERTY_PHYSICAL_SIZE, screen_phys_size);
int screen_resolution[2];
screen_get_display_property_iv(screen_disp, SCREEN_PROPERTY_SIZE, screen_resolution);
double diagonal_pixels = sqrt(screen_resolution[0] * screen_resolution[0] + screen_resolution[1] * screen_resolution[1]);
double diagonal_inches = 0.0393700787 * sqrt(screen_phys_size[0] * screen_phys_size[0] + screen_phys_size[1] * screen_phys_size[1]);
double diagonal_pixels = sqrt((double)(screen_resolution[0] * screen_resolution[0] + screen_resolution[1] * screen_resolution[1]));
double diagonal_inches = 0.0393700787 * sqrt((double)(screen_phys_size[0] * screen_phys_size[0] + screen_phys_size[1] * screen_phys_size[1]));
int dpi = (int)(diagonal_pixels / diagonal_inches + 0.5);
#endif
float dpi_scale = 213.6f / dpi;
+1 -1
View File
@@ -46,7 +46,7 @@ float CalculateDPIScale()
TSize sTwips = CEikonEnv::Static()->ScreenDevice()->SizeInTwips();
float dpi = sqrt((float)(pixel_xres*pixel_xres + pixel_yres*pixel_yres))
/ (sqrt((float)(sTwips.iHeight*sTwips.iHeight + sTwips.iWidth*sTwips.iWidth)) / KTwipsPerInch);
return dpi / 170.0f;
return dpi / 160.0f;
#else
// Sane default for Blackberry and Meego
return 1.2f;