Skip to content

Commit

Permalink
Fix to_local for root gadget.
Browse files Browse the repository at this point in the history
  • Loading branch information
salt-die committed Nov 24, 2024
1 parent b300269 commit 75bf0b9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/batgrl/gadgets/gadget.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,10 +817,8 @@ def to_local(self, point: Point) -> Point:
The point in local coordinates.
"""
if self.parent is None:
return point

y, x = self.parent.to_local(point)
return Point(y - self.top, x - self.left)
return point - self.pos
return self.parent.to_local(point) - self.pos

def collides_point(self, point: Point) -> bool:
"""
Expand Down

0 comments on commit 75bf0b9

Please sign in to comment.