mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Rename all cases of 'pixel density' to 'DPI scale' in love's APIs.
--HG-- branch : minor
This commit is contained in:
@@ -1026,7 +1026,7 @@ void Window::DPIToWindowCoords(double *x, double *y) const
|
||||
*y = py;
|
||||
}
|
||||
|
||||
double Window::getPixelDensity() const
|
||||
double Window::getDPIScale() const
|
||||
{
|
||||
#ifdef LOVE_ANDROID
|
||||
return love::android::getScreenScale();
|
||||
@@ -1037,24 +1037,24 @@ double Window::getPixelDensity() const
|
||||
|
||||
double Window::toPixels(double x) const
|
||||
{
|
||||
return x * getPixelDensity();
|
||||
return x * getDPIScale();
|
||||
}
|
||||
|
||||
void Window::toPixels(double wx, double wy, double &px, double &py) const
|
||||
{
|
||||
double scale = getPixelDensity();
|
||||
double scale = getDPIScale();
|
||||
px = wx * scale;
|
||||
py = wy * scale;
|
||||
}
|
||||
|
||||
double Window::fromPixels(double x) const
|
||||
{
|
||||
return x / getPixelDensity();
|
||||
return x / getDPIScale();
|
||||
}
|
||||
|
||||
void Window::fromPixels(double px, double py, double &wx, double &wy) const
|
||||
{
|
||||
double scale = getPixelDensity();
|
||||
double scale = getDPIScale();
|
||||
wx = px / scale;
|
||||
wy = py / scale;
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
void windowToDPICoords(double *x, double *y) const;
|
||||
void DPIToWindowCoords(double *x, double *y) const;
|
||||
|
||||
double getPixelDensity() const;
|
||||
double getDPIScale() const;
|
||||
|
||||
double toPixels(double x) const;
|
||||
void toPixels(double wx, double wy, double &px, double &py) const;
|
||||
|
||||
Reference in New Issue
Block a user