Fix WordWrap dropping last character of closing tag

Resolves #26.
This commit is contained in:
Trevor Slocum 2020-11-03 11:25:13 -08:00
parent 5ff1168706
commit 888dcd2560
2 changed files with 3 additions and 2 deletions

View File

@ -7,9 +7,10 @@ v1.5.1 (WIP)
- Add SetVisible and GetVisible to all widgets
- Add TextView.SetBytes, TextView.GetBytes and TextView.SetWrapWidth
- Add TableCell.SetBytes, TableCell.GetBytes and TableCell.GetText
- Fix List dividers allowing selection
- Fix List.Transform not calling handler set via SetChangedFunc
- Fix WordWrap bounds out of range
- Fix List dividers allowing selection
- Fix WordWrap dropping last character of closing tag
- Allow modification of scroll bar render text
- Allow scrolling List horizontally
- Clarify that Table rows must each have the same number of columns

View File

@ -554,7 +554,7 @@ func WordWrap(text string, width int) (lines []string) {
}
// Is this a breakpoint?
if breakpointPos < len(breakpoints) && textPos+tagOffset == breakpoints[breakpointPos][0] {
if breakpointPos < len(breakpoints) && textPos+tagOffset == breakpoints[breakpointPos][0]+1 {
// Yes, it is. Set up breakpoint infos depending on its type.
lastBreakpoint = breakpoints[breakpointPos][0] + tagOffset
lastContinuation = breakpoints[breakpointPos][1] + tagOffset