Skip to content

Commit

Permalink
Fix autoscaled nanovg setup
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Oct 11, 2023
1 parent 2ec2504 commit a58498f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dgl/src/OpenGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,10 @@ void SubWidget::PrivateData::display(const uint width, const uint height, const

if (viewportScaleFactor != 0.0 && viewportScaleFactor != 1.0)
{
glViewport(x * viewportScaleFactor, -absolutePos.getY() * viewportScaleFactor, w, h);
glViewport(x,
-static_cast<int>(height * viewportScaleFactor - height + absolutePos.getY() + 0.5),
static_cast<int>(width * viewportScaleFactor + 0.5),
static_cast<int>(height * viewportScaleFactor + 0.5));
}
else
{
Expand Down

0 comments on commit a58498f

Please sign in to comment.