mirror of
https://github.com/3b1b/manim.git
synced 2025-11-15 05:17:47 +00:00
Fix frame scaling
This commit is contained in:
parent
277c471c90
commit
71bd3edb09
2 changed files with 4 additions and 4 deletions
|
|
@ -90,8 +90,8 @@ class CameraFrame(Mobject):
|
|||
"""
|
||||
shift = Matrix44.from_translation(-self.get_center()).T
|
||||
rotation = Matrix44.from_quaternion(self.uniforms["orientation"]).T
|
||||
self.view_matrix[:] = np.dot(rotation, shift)
|
||||
self.view_matrix[:3, :3] /= self.get_scale()
|
||||
scale = Matrix44(np.identity(3) / self.get_scale())
|
||||
self.view_matrix[:] = shift * rotation * scale
|
||||
return self.view_matrix
|
||||
|
||||
def get_inv_view_matrix(self):
|
||||
|
|
|
|||
|
|
@ -821,7 +821,7 @@ class Scene(object):
|
|||
frame.increment_phi(ff_d_point[1])
|
||||
# Handle frame movements
|
||||
elif self.window.is_key_pressed(ord(FRAME_SHIFT_KEY)):
|
||||
frame.shift(-d_point / self.frame.get_scale())
|
||||
frame.shift(-d_point)
|
||||
|
||||
def on_mouse_drag(
|
||||
self,
|
||||
|
|
@ -831,7 +831,7 @@ class Scene(object):
|
|||
modifiers: int
|
||||
) -> None:
|
||||
self.mouse_drag_point.move_to(point)
|
||||
self.frame.shift(-d_point / self.frame.get_scale())
|
||||
self.frame.shift(-d_point)
|
||||
|
||||
event_data = {"point": point, "d_point": d_point, "buttons": buttons, "modifiers": modifiers}
|
||||
propagate_event = EVENT_DISPATCHER.dispatch(EventType.MouseDragEvent, **event_data)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue