From 7d47207d346494f869ab43f1074cf63298237c5f Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Sat, 18 Mar 2017 23:16:07 +0700 Subject: [PATCH] Fix viewport Y for negative scale. Fixed #1426, regression in eiko st andrews --- src/GraphicsDrawer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GraphicsDrawer.cpp b/src/GraphicsDrawer.cpp index 2a5fb432..af027198 100644 --- a/src/GraphicsDrawer.cpp +++ b/src/GraphicsDrawer.cpp @@ -223,7 +223,7 @@ void GraphicsDrawer::_updateViewport() const if (_needAdjustCoordinate(wnd)) Xf = _adjustViewportX(Xf); const s32 X = (s32)(Xf * scaleX); - const s32 Y = (s32)(gSP.viewport.y * scaleY); + const s32 Y = gSP.viewport.vscale[1] < 0 ? (s32)((gSP.viewport.y + gSP.viewport.vscale[1] * 2.0f) * scaleY) : (s32)(gSP.viewport.y * scaleY); gfxContext.setViewport(X, Y, std::max((s32)(gSP.viewport.width * scaleX), 0), std::max((s32)(gSP.viewport.height * scaleY), 0)); }