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

Open Beginner friendly
#628 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
go
Domain
game-dev

Research direction

Search the Panels system for the effectiveWrap calculation and inspect how it is used when rendering a PanelRow with a larger WrapWidth. Reproduce the example with the 20-wide panel, then verify that wrapped lines stay within the panel width and that existing panel rendering still works.

Written by the indexing model from the issue text.

Description

I discovered this while adding my AddBlock into the Panels system. Take the following example:

p := makePanel("x", "X", 20, borderFull, []PanelRow{
		{
			ShortLabel: "A:",
			FullLabel:  "Alpha: ",
			Value:      "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since 1966, when designers at Letraset and James Mosley, the librarian at St Bride Printing Library in London, took a 1914 Cicero translation and scrambled it to make dummy text for Letraset's Body Type sheets.",
			WrapWidth:  60,
		},
	})

This will produce output that looks like:

┌─ X ──────────────┐
│ A: Lorem Ipsum is simply dummy text of the printing and │
│    typesetting industry. Lorem Ipsum has been the industry's│
│    standard dummy text ever since 1966, when designers at│
│    Letraset and James Mosley, the librarian at St Bride│
│    Printing Library in London, took a 1914 Cicero translation│
│    and scrambled it to make dummy text for Letraset's Body│
│    Type sheets.  │
└──────────────────┘

The reason is that the panels system never checks to see if effectiveWrap fits within the panel width.

Dominant language
Go
Stars
234
Forks
52
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GoMudEngine/GoMud

All issues in GoMudEngine/GoMud

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.