From ee95d40830e6f8f17c8ddfd5d210bbb9f833d265 Mon Sep 17 00:00:00 2001 From: julee Date: Thu, 28 Mar 2024 07:13:47 +0000 Subject: [PATCH] TextWriter2D: Fix the viewport calculation error in text rendering --- moderngl_window/text/bitmapped/text_2d.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moderngl_window/text/bitmapped/text_2d.py b/moderngl_window/text/bitmapped/text_2d.py index 1deaaa3..c774a92 100644 --- a/moderngl_window/text/bitmapped/text_2d.py +++ b/moderngl_window/text/bitmapped/text_2d.py @@ -74,7 +74,7 @@ def _write(self, text: str): def draw(self, pos, length=-1, size=24.0): # Calculate ortho projection based on viewport vp = self.ctx.fbo.viewport - w, h = vp[2] - vp[0], vp[3] - vp[1] + w, h = vp[2], vp[3] projection = matrix44.create_orthogonal_projection_matrix( 0, # left w, # right