mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
reduce annoying errors
This commit is contained in:
parent
3d118a5bb6
commit
f6b5edede2
1 changed files with 7 additions and 2 deletions
|
@ -539,9 +539,14 @@ class Scene(object):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def on_key_press(self, symbol, modifiers):
|
def on_key_press(self, symbol, modifiers):
|
||||||
if chr(symbol) == "r":
|
try:
|
||||||
|
char = chr(symbol)
|
||||||
|
except OverflowError:
|
||||||
|
print(" Warning: The value of the pressed key is too large.")
|
||||||
|
return
|
||||||
|
if char == "r":
|
||||||
self.camera.frame.to_default_state()
|
self.camera.frame.to_default_state()
|
||||||
elif chr(symbol) == "q":
|
elif char == "q":
|
||||||
self.quit_interaction = True
|
self.quit_interaction = True
|
||||||
|
|
||||||
def on_resize(self, width: int, height: int):
|
def on_resize(self, width: int, height: int):
|
||||||
|
|
Loading…
Add table
Reference in a new issue