Skip to content

Commit 3c45757

Browse files
committed
fix: Account for dx9 half pixel offset
1 parent 331ca19 commit 3c45757

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

imgui/imgui_impl_source.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ void ImGui_ImplSource_SetupRenderState( IMatRenderContext *ctx, ImDrawData *draw
7474
ctx->LoadIdentity();
7575
ctx->Scale( 1, -1, 1 );
7676

77-
float L = draw_data->DisplayPos.x;
78-
float R = draw_data->DisplayPos.x + draw_data->DisplaySize.x;
79-
float T = draw_data->DisplayPos.y;
80-
float B = draw_data->DisplayPos.y + draw_data->DisplaySize.y;
77+
float L = draw_data->DisplayPos.x + 0.5f;
78+
float R = draw_data->DisplayPos.x + draw_data->DisplaySize.x + 0.5f;
79+
float T = draw_data->DisplayPos.y + 0.5f;
80+
float B = draw_data->DisplayPos.y + draw_data->DisplaySize.y + 0.5f;
8181
ctx->Ortho( L, T, R, B, 0.f, 1.f );
8282

8383
ctx->MatrixMode( MATERIAL_VIEW );

0 commit comments

Comments
 (0)