mirror of
https://github.com/love2d/love.git
synced 2026-08-20 12:40:20 +02:00
Fix some DPI scale calculations to work with depth-only rendering.
This commit is contained in:
@@ -334,11 +334,9 @@ int Graphics::getPixelHeight() const
|
|||||||
|
|
||||||
double Graphics::getCurrentDPIScale() const
|
double Graphics::getCurrentDPIScale() const
|
||||||
{
|
{
|
||||||
if (states.back().renderTargets.colors.size() > 0)
|
const auto &rt = states.back().renderTargets.getFirstTarget();
|
||||||
{
|
if (rt.canvas.get())
|
||||||
Canvas *c = states.back().renderTargets.getFirstTarget().canvas.get();
|
return rt.canvas->getDPIScale();
|
||||||
return (double) c->getPixelHeight() / (double) c->getHeight();
|
|
||||||
}
|
|
||||||
|
|
||||||
return getScreenDPIScale();
|
return getScreenDPIScale();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user