diff options
author | Jeffrey Armstrong <jeff@approximatrix.com> | 2020-06-18 20:05:37 -0400 |
---|---|---|
committer | Jeffrey Armstrong <jeff@approximatrix.com> | 2020-06-18 20:05:37 -0400 |
commit | 2e87199d7b27f8e2ca03ccbf13cfa01fc23d2865 (patch) | |
tree | bbce1c1c56dc53245f96173301789114bb4ec247 /render.f90 | |
parent | 42bdfe78ed03e1ba4355edcac43ad2217631ce05 (diff) | |
download | LR-87-2e87199d7b27f8e2ca03ccbf13cfa01fc23d2865.tar.gz LR-87-2e87199d7b27f8e2ca03ccbf13cfa01fc23d2865.zip |
Improved line wrapping calcs to search for break from beginning of string. Fixed unnecessary connection error when reporting unsupported protocol by adding a protocol fail status.
Diffstat (limited to 'render.f90')
-rw-r--r-- | render.f90 | 26 |
1 files changed, 18 insertions, 8 deletions
@@ -296,7 +296,7 @@ contains integer, intent(in)::startpos integer, intent(in)::proportional_type integer::endpos - integer::my_start + integer::my_start, last_end integer::w my_start = startpos @@ -306,15 +306,25 @@ contains endpos = len_trim(text) w = width_of_line(r, text, my_start, endpos, proportional_type) - do while(w > r%max_width) - - endpos = endpos - 1 - do while(text(endpos:endpos) /= ' ' .and. text(endpos:endpos) /= '-' .and. endpos > my_start) - endpos = endpos - 1 + if(w > r%max_width) then + + w = 0 + endpos = startpos+1 + do while(w <= r%max_width) + + last_end = endpos + endpos = endpos + 1 + do while(text(endpos:endpos) /= ' ' .and. text(endpos:endpos) /= '-') + endpos = endpos + 1 + end do + + w = width_of_line(r, text, my_start, endpos, proportional_type) + end do - w = width_of_line(r, text, my_start, endpos, proportional_type) - end do + endpos = last_end + + end if end function wrap_line |