diff --git a/manimlib/camera/camera.py b/manimlib/camera/camera.py index 2b54752f..a3f4e5b5 100644 --- a/manimlib/camera/camera.py +++ b/manimlib/camera/camera.py @@ -169,10 +169,10 @@ class Camera(object): # Getting camera attributes def get_pixel_size(self) -> float: - return self.frame.get_shape()[0] / self.get_pixel_shape()[0] + return self.frame.get_width() / self.get_pixel_shape()[0] def get_pixel_shape(self) -> tuple[int, int]: - return self.draw_fbo.size + return self.fbo.size def get_pixel_width(self) -> int: return self.get_pixel_shape()[0] @@ -233,7 +233,7 @@ class Camera(object): self.uniforms.update( view=tuple(view_matrix.T.flatten()), focal_distance=frame.get_focal_distance() / frame.get_scale(), - frame_shape=frame.get_shape(), + frame_scale=frame.get_scale(), pixel_size=self.get_pixel_size(), camera_position=tuple(cam_pos), light_position=tuple(light_pos), diff --git a/manimlib/shaders/quadratic_bezier_stroke/vert.glsl b/manimlib/shaders/quadratic_bezier_stroke/vert.glsl index e673f8dc..b221536a 100644 --- a/manimlib/shaders/quadratic_bezier_stroke/vert.glsl +++ b/manimlib/shaders/quadratic_bezier_stroke/vert.glsl @@ -1,6 +1,7 @@ #version 330 -uniform vec2 frame_shape; +uniform float frame_scale; +uniform float is_fixed_in_frame; in vec3 point; in vec4 stroke_rgba; @@ -20,7 +21,10 @@ const float STROKE_WIDTH_CONVERSION = 0.01; void main(){ verts = point; - v_stroke_width = STROKE_WIDTH_CONVERSION * stroke_width * frame_shape[1] / 8.0; + v_stroke_width = STROKE_WIDTH_CONVERSION * stroke_width; + if(!bool(is_fixed_in_frame)){ + v_stroke_width *= frame_scale; + } v_joint_product = joint_product; v_color = stroke_rgba; v_vert_index = gl_VertexID;