Browse files

UI: Fix D3D9 half-pixel offset at 1x.

Since we scale by 0.5x for small window, we need to adjust the half pixel
offset to match real pixels.
  • Loading branch information...
unknownbrackets committed Dec 3, 2017
1 parent aa0cc67 commit 84f5f633df7d46691091974ce9888a1a7d6e8110
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;
case GPUBackend::DIRECT3D11:

0 comments on commit 84f5f63

Please sign in to comment.