Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
pokepetter committed Oct 14, 2023
2 parents 1047690 + 115ff73 commit f32184c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ursina/prefabs/grid_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def update(self):
y = int(round(self.cursor.y * self.h))
x = int(round(self.cursor.x * self.w))
if x < 0 or x > self.w-1 or y < 0 or y > self.h-1:
self.prev_draw = (clamp(x, 0, self.w), clamp(y, 0, self.h))
return

if not held_keys['alt'] and not self.is_in_paste_mode:
Expand Down Expand Up @@ -190,7 +191,7 @@ def input(self, key):
if not self.edit_mode:
return

if key == 'left mouse down' and not self.is_in_paste_mode:
if key == 'left mouse down' and self.canvas_collider.hovered and not self.is_in_paste_mode:
self.start_pos = self.get_cursor_position()
if not held_keys['control']:
self.prev_draw = None
Expand Down
3 changes: 3 additions & 0 deletions ursina/ursinastuff.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ def _destroy(entity, force_destroy=False):
if hasattr(entity, '_on_click') and isinstance(entity._on_click, Sequence):
entity._on_click.kill()

if entity.hasPythonTag("Entity"):
entity.clearPythonTag("Entity")

entity.removeNode()
#unload texture
# if hasattr(entity, 'texture') and entity.texture != None:
Expand Down

0 comments on commit f32184c

Please sign in to comment.