mirror of
https://github.com/love2d/love.git
synced 2026-08-19 04:06:17 +02:00
Merge branch 'main' into 12.0-development
This commit is contained in:
@@ -1309,6 +1309,13 @@ int Window::getPixelHeight() const
|
||||
return pixelHeight;
|
||||
}
|
||||
|
||||
void Window::clampPositionInWindow(double *wx, double *wy) const
|
||||
{
|
||||
if (wx != nullptr)
|
||||
*wx = std::min(std::max(0.0, *wx), (double) getWidth() - 1);
|
||||
if (wy != nullptr)
|
||||
*wy = std::min(std::max(0.0, *wy), (double) getHeight() - 1);
|
||||
}
|
||||
|
||||
void Window::windowToPixelCoords(double *x, double *y) const
|
||||
{
|
||||
|
||||
@@ -107,6 +107,8 @@ public:
|
||||
int getPixelWidth() const override;
|
||||
int getPixelHeight() const override;
|
||||
|
||||
void clampPositionInWindow(double *wx, double *wy) const override;
|
||||
|
||||
void windowToPixelCoords(double *x, double *y) const override;
|
||||
void pixelToWindowCoords(double *x, double *y) const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user