diff --git a/src/imgui_impl.ts b/src/imgui_impl.ts index 50a5b84..a085ec5 100644 --- a/src/imgui_impl.ts +++ b/src/imgui_impl.ts @@ -78,11 +78,12 @@ const R: number = draw_data.DisplayPos.x + draw_data.DisplaySize.x; const T: number = draw_data.DisplayPos.y; const B: number = draw_data.DisplayPos.y + draw_data.DisplaySize.y; + // we actually flip the bottom and top here to match with PIXI's texture usage const ortho_projection: Float32Array = new Float32Array([ 2.0 / (R - L), 0.0, 0.0, 0.0, - 0.0, 2.0 / (T - B), 0.0, 0.0, + 0.0, 2.0 / (B - T), 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, - (R + L) / (L - R), (T + B) / (B - T), 0.0, 1.0, + (R + L) / (L - R), (B + T) / (T - B), 0.0, 1.0, ]); gl && gl.useProgram(g_ShaderHandle); gl && gl.uniform1i(g_AttribLocationTex, 0);