fixed issue with bounding box height being wrong
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user