gurkenlabs / litiengine

LITIENGINE 🕹 The pure 2D java game engine.
https://litiengine.com/
MIT License
718 stars 94 forks source link

Fix alignment of text that overflows the boundaries #816

Closed hedfol closed 3 months ago

hedfol commented 3 months ago

Add getLocation method overload to Align and Valign enums. Implement an option to prevent the values that are out of bounds.

Make getLocation calls in text scenarios use preventOverflow option. Do not alter the default uses of getLocation for entities.

Add basic tests for Align.getLocation with preventOverflow:true. Create similar tests for Valign.getLocation: default and no-overflow.

hedfol commented 3 months ago

Let me know what should be changed.