Permalink
Browse files

Merge pull request #10243 from unknownbrackets/d3d9-1x

UI: Fix D3D9 half-pixel offset at 1x
  • Loading branch information...
hrydgard committed Dec 3, 2017
2 parents aa0cc67 + 84f5f63 commit 5eba689d6e8cfe898471aae1b684f52966ef4673
Showing with 2 additions and 1 deletion.
  1. +2 −1 UI/NativeApp.cpp
@@ -814,7 +814,8 @@ void NativeRender(GraphicsContext *graphicsContext) {
case GPUBackend::DIRECT3D9:
ortho.setOrthoD3D(0.0f, xres, yres, 0.0f, -1.0f, 1.0f);
Matrix4x4 translation;
translation.setTranslation(Vec3(-0.5f, -0.5f, 0.0f));
// Account for the small window adjustment.
translation.setTranslation(Vec3(-0.5f * g_dpi_scale_x / g_dpi_scale_real_x, -0.5f * g_dpi_scale_y / g_dpi_scale_real_y, 0.0f));
ortho = translation * ortho;
break;
case GPUBackend::DIRECT3D11:

0 comments on commit 5eba689

Please sign in to comment.