Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Quick fix to a bug where ImageMobjects of size zero weren't displayed

Grant Sanderson60caf2312c84
diff --git a/camera/camera.py b/camera/camera.py
index b62f847f3..e0e011ce4 100644
--- a/camera/camera.py
+++ b/camera/camera.py
@@ -438,8 +438,8 @@ class Camera(object):
)
# Reshape
- pixel_width = int(pdist([ul_coords, ur_coords]))
- pixel_height = int(pdist([ul_coords, dl_coords]))
+ pixel_width = max(int(pdist([ul_coords, ur_coords])), 1)
+ pixel_height = max(int(pdist([ul_coords, dl_coords])), 1)
sub_image = sub_image.resize(
(pixel_width, pixel_height), resample=Image.BICUBIC
)