Mercurial > hg > svgui
comparison view/ViewManager.cpp @ 908:4a578a360011 cxx11
More type fixes
author | Chris Cannam |
---|---|
date | Tue, 10 Mar 2015 13:22:10 +0000 |
parents | a1226b3b7925 |
children | b48db6f1a7d2 |
comparison
equal
deleted
inserted
replaced
907:28d05ae8741c | 908:4a578a360011 |
---|---|
721 } | 721 } |
722 | 722 |
723 int | 723 int |
724 ViewManager::scalePixelSize(int pixels) | 724 ViewManager::scalePixelSize(int pixels) |
725 { | 725 { |
726 static float ratio = 0.f; | 726 static double ratio = 0.0; |
727 if (ratio == 0.f) { | 727 if (ratio == 0.0) { |
728 float baseEm; | 728 double baseEm; |
729 #ifdef Q_OS_MAC | 729 #ifdef Q_OS_MAC |
730 baseEm = 17.f; | 730 baseEm = 17.0; |
731 #else | 731 #else |
732 baseEm = 15.f; | 732 baseEm = 15.0; |
733 #endif | 733 #endif |
734 float em = QFontMetrics(QFont()).height(); | 734 double em = QFontMetrics(QFont()).height(); |
735 ratio = em / baseEm; | 735 ratio = em / baseEm; |
736 } | 736 } |
737 | 737 |
738 int scaled = int(pixels * ratio + 0.5); | 738 int scaled = int(pixels * ratio + 0.5); |
739 cerr << "scaledSize: " << pixels << " -> " << scaled << " at ratio " << ratio << endl; | 739 cerr << "scaledSize: " << pixels << " -> " << scaled << " at ratio " << ratio << endl; |