From ccb47db3bb337596bd77ebb0f0061c9c3f0f1ebe Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Sat, 30 May 2020 16:48:01 -0700 Subject: [PATCH] fix pixel_coords_to_space_coords --- manimlib/camera/camera.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manimlib/camera/camera.py b/manimlib/camera/camera.py index 8603f78b..59f18cfb 100644 --- a/manimlib/camera/camera.py +++ b/manimlib/camera/camera.py @@ -186,7 +186,11 @@ class Camera(object): self.frame.move_to(center) def pixel_coords_to_space_coords(self, px, py, relative=False): - pw, ph = self.fbo.size + # pw, ph = self.fbo.size + # Back hack, not sure why this is needed. + pw, ph = self.get_pixel_shape() + pw //= 2 + ph //= 2 fw, fh = self.get_frame_shape() fc = self.get_frame_center() if relative: