Fix some DPI scale calculations to work with depth-only rendering.

This commit is contained in:
Alex Szpakowski
2018-01-21 17:35:57 -04:00
parent 9dd1293f09
commit a2454d74cd
+3 -5
View File
@@ -334,11 +334,9 @@ int Graphics::getPixelHeight() const
double Graphics::getCurrentDPIScale() const
{
if (states.back().renderTargets.colors.size() > 0)
{
Canvas *c = states.back().renderTargets.getFirstTarget().canvas.get();
return (double) c->getPixelHeight() / (double) c->getHeight();
}
const auto &rt = states.back().renderTargets.getFirstTarget();
if (rt.canvas.get())
return rt.canvas->getDPIScale();
return getScreenDPIScale();
}