fixed issue with bounding box height being wrong
Python CI / test (3.10) (push) Has been cancelled
Python CI / test (3.12) (push) Has been cancelled
Python CI / test (3.13) (push) Has been cancelled

This commit is contained in:
2025-11-09 17:10:50 +01:00
parent 56c2c21021
commit 50b9aa5431
4 changed files with 56 additions and 13 deletions
+7 -1
View File
@@ -76,8 +76,14 @@ class TestText(unittest.TestCase):
def test_in_object_true(self):
text_instance = Text(text="Test", style=self.style, draw=self.draw)
# Set origin at baseline position (50, 50)
text_instance.set_origin(np.array([50, 50]))
# Test with a point that should be inside the text bounds
point = (5, 5)
# The text origin is at the baseline (50, 50)
# Visual bounds are: top = 50 - ascent, bottom = 50 + descent
# So a point at (55, 50) should be inside (at baseline)
point = (55, 50)
self.assertTrue(text_instance.in_object(point))
def test_in_object_false(self):