mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Change crosshair behavior
This commit is contained in:
parent
ca523c8a5e
commit
117a34dc67
1 changed files with 9 additions and 4 deletions
|
@ -290,6 +290,8 @@ class InteractiveScene(Scene):
|
||||||
)
|
)
|
||||||
result.add_updater(lambda m: m.replace(mobject, stretch=True))
|
result.add_updater(lambda m: m.replace(mobject, stretch=True))
|
||||||
return result
|
return result
|
||||||
|
elif isinstance(mobject, DotCloud):
|
||||||
|
return Mobject()
|
||||||
else:
|
else:
|
||||||
return self.get_corner_dots(mobject)
|
return self.get_corner_dots(mobject)
|
||||||
|
|
||||||
|
@ -483,7 +485,12 @@ class InteractiveScene(Scene):
|
||||||
large=(modifiers & SHIFT_MODIFIER),
|
large=(modifiers & SHIFT_MODIFIER),
|
||||||
)
|
)
|
||||||
# Adding crosshair
|
# Adding crosshair
|
||||||
if char in [SELECT_KEY, CURSOR_KEY]:
|
if char == CURSOR_KEY:
|
||||||
|
if self.crosshair in self.mobjects:
|
||||||
|
self.remove(self.crosshair)
|
||||||
|
else:
|
||||||
|
self.add(self.crosshair)
|
||||||
|
if char == SELECT_KEY:
|
||||||
self.add(self.crosshair)
|
self.add(self.crosshair)
|
||||||
|
|
||||||
# Conditions for saving state
|
# Conditions for saving state
|
||||||
|
@ -494,15 +501,13 @@ class InteractiveScene(Scene):
|
||||||
super().on_key_release(symbol, modifiers)
|
super().on_key_release(symbol, modifiers)
|
||||||
if chr(symbol) == SELECT_KEY:
|
if chr(symbol) == SELECT_KEY:
|
||||||
self.gather_new_selection()
|
self.gather_new_selection()
|
||||||
|
# self.remove(self.crosshair)
|
||||||
if chr(symbol) in GRAB_KEYS:
|
if chr(symbol) in GRAB_KEYS:
|
||||||
self.is_grabbing = False
|
self.is_grabbing = False
|
||||||
elif chr(symbol) == INFORMATION_KEY:
|
elif chr(symbol) == INFORMATION_KEY:
|
||||||
self.display_information(False)
|
self.display_information(False)
|
||||||
elif symbol == SHIFT_SYMBOL and self.window.is_key_pressed(ord(RESIZE_KEY)):
|
elif symbol == SHIFT_SYMBOL and self.window.is_key_pressed(ord(RESIZE_KEY)):
|
||||||
self.prepare_resizing(about_corner=False)
|
self.prepare_resizing(about_corner=False)
|
||||||
# Removing crosshair
|
|
||||||
if chr(symbol) in [SELECT_KEY, CURSOR_KEY]:
|
|
||||||
self.remove(self.crosshair)
|
|
||||||
|
|
||||||
# Mouse actions
|
# Mouse actions
|
||||||
def handle_grabbing(self, point: np.ndarray):
|
def handle_grabbing(self, point: np.ndarray):
|
||||||
|
|
Loading…
Add table
Reference in a new issue