mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00
Fix scroll zooming
This commit is contained in:
parent
0d9bb71d3c
commit
901d40ba11
1 changed files with 4 additions and 6 deletions
|
@ -25,6 +25,7 @@ from manimlib.constants import DEFAULT_WAIT_TIME
|
|||
from manimlib.constants import COMMAND_MODIFIER
|
||||
from manimlib.constants import SHIFT_MODIFIER
|
||||
from manimlib.constants import RED
|
||||
from manimlib.constants import FRAME_HEIGHT
|
||||
from manimlib.event_handler import EVENT_DISPATCHER
|
||||
from manimlib.event_handler.event_type import EventType
|
||||
from manimlib.logger import log
|
||||
|
@ -871,14 +872,11 @@ class Scene(object):
|
|||
return
|
||||
|
||||
frame = self.camera.frame
|
||||
offset *= self.scroll_sensitivity
|
||||
if self.window.is_key_pressed(ord(ZOOM_KEY)):
|
||||
frame.scale(
|
||||
1 - offset[1] / frame.get_height(),
|
||||
about_point=point
|
||||
)
|
||||
ff_offset = offset * FRAME_HEIGHT / frame.get_height()
|
||||
frame.scale(1 - ff_offset[1], about_point=point)
|
||||
else:
|
||||
frame.shift(-offset)
|
||||
frame.shift(-self.scroll_sensitivity * offset)
|
||||
|
||||
def on_key_release(
|
||||
self,
|
||||
|
|
Loading…
Add table
Reference in a new issue