Browse Source

Fix OpenGL viewport size for fullviewport-drawing and auto-scaling

Signed-off-by: falkTX <falktx@falktx.com>
pull/309/head
falkTX 4 years ago
parent
commit
10419b8947
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      dgl/src/OpenGL.cpp

+ 4
- 1
dgl/src/OpenGL.cpp View File

@@ -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
{


Loading…
Cancel
Save