commit 10419b8947018d21eb6ddbf97109357dc225e1da
parent b88e92c522fe0fe8e83a6084d0bfdaa000e0c9bf
Author: falkTX <falktx@falktx.com>
Date: Sat, 14 Aug 2021 13:21:14 +0100
Fix OpenGL viewport size for fullviewport-drawing and auto-scaling
Signed-off-by: falkTX <falktx@falktx.com>
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dgl/src/OpenGL.cpp b/dgl/src/OpenGL.cpp
@@ -598,7 +598,10 @@ void SubWidget::PrivateData::display(const uint width, const uint height, const
else if (needsFullViewportForDrawing || (absolutePos.isZero() && self->getSize() == Size<uint>(width, height)))
{
// full viewport size
- glViewport(0, 0, static_cast<int>(width), static_cast<int>(height));
+ glViewport(0,
+ -static_cast<int>(height * autoScaleFactor - height + 0.5),
+ static_cast<int>(width * autoScaleFactor + 0.5),
+ static_cast<int>(height * autoScaleFactor + 0.5));
}
else
{