aboutsummaryrefslogtreecommitdiff
path: root/render.f90
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2020-06-18 20:05:37 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2020-06-18 20:05:37 -0400
commit2e87199d7b27f8e2ca03ccbf13cfa01fc23d2865 (patch)
treebbce1c1c56dc53245f96173301789114bb4ec247 /render.f90
parent42bdfe78ed03e1ba4355edcac43ad2217631ce05 (diff)
downloadLR-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.f9026
1 files changed, 18 insertions, 8 deletions
diff --git a/render.f90 b/render.f90
index b37eb50..54f50e4 100644
--- a/render.f90
+++ b/render.f90
@@ -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