~azzar1/nux/fix-965025

« back to all changes in this revision

Viewing changes to Nux/EMMetrics.cpp

* Removing obsolete include file in GraphicsDisplayWin.cpp.
* Renaming Nux/Metrics.cpp to Nux/EMMetrics.cpp. Same for .h file.
* Updated file tests/gtest-nux-emmetrics.cpp to use nux::EMMetrics. Fixes: . Approved by Jay Taoko.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * Authored by: Mirco Müller <mirco.mueller@canonical.com
17
17
 */
18
18
 
19
 
#include "Nux/Metrics.h"
 
19
#include "Nux/EMMetrics.h"
20
20
 
21
21
namespace nux
22
22
{
23
 
  Metrics::Metrics(Display* dpy, int scr, double points)
 
23
  EMMetrics::EMMetrics(Display* dpy, int scr, double points)
24
24
  {
25
25
    double xres = 0.0;
26
26
    double yres = 0.0;
44
44
      pixels_per_em_ = 10.0; // assume points == 10.0, dpi == 96.0
45
45
  }
46
46
 
47
 
  double Metrics::Pixel2EM(int value)
 
47
  double EMMetrics::Pixel2EM(int value)
48
48
  {
49
49
    return static_cast<double> (value) / pixels_per_em_;
50
50
  }
51
51
 
52
 
  int Metrics::EM2Pixel(double value)
 
52
  int EMMetrics::EM2Pixel(double value)
53
53
  {
54
54
    return static_cast<int> (value * pixels_per_em_);
55
55
  }