Wrapped text becomes a single line when the expected item rectangle is not in the viewport #706

Closed
opened 2016-06-18 13:46:22 +00:00 by YukinoHayakawa · 2 comments
YukinoHayakawa commented 2016-06-18 13:46:22 +00:00 (Migrated from github.com)

wordwrap

I'm making a resource manager displaying item groups consist of a thumbnail and a name respectively, and I'm wrapping the name text like the Windows Explorer does because I don't want it to expand the width of the group. However this strange behavior happens when I moves the manager window around, and disturbs the layout.

I've found that if TextWrapPos == -1.f is used to determine whether wrapping is enabled, but I can't see any difference changing it, so I suspect there might be some other positional / clipping calculations involed.

I hope this could be fixed or an corrected code replacing the old in the demo. Thank you.

![wordwrap](https://cloud.githubusercontent.com/assets/968003/16171162/ef85ab9a-359a-11e6-8db0-ddaf6e10cc75.gif) I'm making a resource manager displaying item groups consist of a thumbnail and a name respectively, and I'm wrapping the name text like the Windows Explorer does because I don't want it to expand the width of the group. However this strange behavior happens when I moves the manager window around, and disturbs the layout. I've found that if TextWrapPos == -1.f is used to determine whether wrapping is enabled, but I can't see any difference changing it, so I suspect there might be some other positional / clipping calculations involed. I hope this could be fixed or an corrected code replacing the old in the demo. Thank you.
ocornut commented 2016-06-19 10:38:57 +00:00 (Migrated from github.com)

Good catch!

Good catch!
ocornut commented 2016-06-19 10:50:39 +00:00 (Migrated from github.com)

Fixed!

Fixed!
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#706
No description provided.