KSP-KOS / KOS

Fully programmable autopilot mod for KSP. Originally By Nivekk
Other
697 stars 230 forks source link

GUI: let kerboscripts turn off wordWrap so things format properly #2599

Closed Dunbaratu closed 5 years ago

Dunbaratu commented 5 years ago

Unity's IMGUI has a field on GUISkin called `wordWrap that decides whether or not it's allowed to break up labels on word boundaries to make them fit. We have it on by default. But that is the main reason the GUI displays come out all wonky by default. Someone makes a gui with a label like "This is My Label" and it displays like this instead:

This
is My
Label

The only way to stop it doing that is to set a fixed width to the GUI box like so: GUI(400). If the hardcoded size is long enough to make it not need to wrap, that's the only way to stop it wrapping. As long as you're letting it stretch and flow the content and decide the box size for you, it will always seem to prefer the narrower window, and if it has to break up things in a silly way to do that, it will choose to do so, giving the effect shown above.

We should expose wordWrap so users can fix this annoying feature of Unity IMGUI. I might even want to see it be the default but that might mess it up for other people.

ThunderousEcho commented 5 years ago

Working on this.

ThunderousEcho commented 5 years ago

wordWrap is exposed on my branch.