britzl / gooey

Defold GUI system
MIT License
150 stars 22 forks source link

Keep input text in the node's bounds #64

Closed JustAPotota closed 3 years ago

JustAPotota commented 3 years ago

Prevent the text in an input node from exceeding the node's width, unless config.keep_in_bounds is set to false.

britzl commented 3 years ago

Something like this is a good addition for sure! But I wonder if it isn't better to not show the overflowing text? I can't think of a scenario when it is ok to let the text overflow. Your solution obviously prevents it though, but I think limiting what can be seen is a better solution.

I released a new version where overflowing text isn't drawn: https://github.com/britzl/gooey/releases/tag/9.1.0

Let me know your thoughts on this and if there is still a usecase for your specific solution!

JustAPotota commented 3 years ago

Yes, that is a much better solution. Only thing missing is that input.text_width doesn't get set properly.

britzl commented 3 years ago

Good point! I've fixed this in 9.1.1. I'm closing this PR.