From 10419b8947018d21eb6ddbf97109357dc225e1da Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 14 Aug 2021 13:21:41 +0100 Subject: [PATCH] Fix OpenGL viewport size for fullviewport-drawing and auto-scaling Signed-off-by: falkTX --- dgl/src/OpenGL.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dgl/src/OpenGL.cpp b/dgl/src/OpenGL.cpp index df91b34b..8cc6d889 100644 --- 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(width, height))) { // full viewport size - glViewport(0, 0, static_cast(width), static_cast(height)); + glViewport(0, + -static_cast(height * autoScaleFactor - height + 0.5), + static_cast(width * autoScaleFactor + 0.5), + static_cast(height * autoScaleFactor + 0.5)); } else {