Skip to content

Fix: Fix Wrapping Logic in Panels#629

Open
ccubed wants to merge 1 commit into
GoMudEngine:masterfrom
ccubed:FixWrap
Open

Fix: Fix Wrapping Logic in Panels#629
ccubed wants to merge 1 commit into
GoMudEngine:masterfrom
ccubed:FixWrap

Conversation

@ccubed

@ccubed ccubed commented Jun 16, 2026

Copy link
Copy Markdown

Description

This fix adjusts the wrapping logic for panels to ensure that effectiveWidth will fit inside the visible panel width. Before this change, it is possible that effectiveWidth would be greater than the visible panel width which would produce misaligned panels. Also add two test cases AllLinesFitInsideWidth and AllLinesFitInsideWidthWithMismatchedWrap. The first one simply tests that given a large line of text and a small panel width the lines fit within the panel width. The second one tests that passing a larger WrapWidth than the panel width doesn't produce oversized lines.

This will still break if your panel width is small enough that we aren't able to split the string into tokens based on the width. I've found that 14 seems to be the minimum size needed to display a panel correctly.

Changes

Provide a bullet point list of noteworthy changes in this Pull Request:

…the panel width. Also add two test cases `AllLinesFitInsideWidth` and `AllLinesFitInsideWidthWithMismatchedWrap`. The first one simply tests that given a large line of text and a small panel width the lines fit within the panel width. The second one tests that passing a larger WrapWidth than the panel width doesn't produce oversized lines.
@ccubed ccubed requested a review from Volte6 as a code owner June 16, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Wrapping can fail in panels because effectiveWrap can be greater than panel width

1 participant