aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2021-04-19 09:36:21 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2021-04-19 09:36:21 -0400
commitc4274b0bb964f4e965d10cbc2b137a0bfc9c9ebf (patch)
treebaefc0578dda240eb1c12e36076928da0b48e426
parent313ea185e0b3e43b5d464cbce4ccf2db953e4da7 (diff)
downloadLR-87-c4274b0bb964f4e965d10cbc2b137a0bfc9c9ebf.zip
LR-87-c4274b0bb964f4e965d10cbc2b137a0bfc9c9ebf.tar.gz
Fixed rendering of single-character lines
-rw-r--r--files.f902
-rw-r--r--layout.f901
-rw-r--r--main.F902
-rw-r--r--render.f906
4 files changed, 7 insertions, 4 deletions
diff --git a/files.f90 b/files.f90
index 1c76311..f405d00 100644
--- a/files.f90
+++ b/files.f90
@@ -128,7 +128,7 @@ contains
logical, intent(inout)::preformatted_on
integer::line_length
-
+
if(file_type == file_type_plain_text) then
single_line%line_type = line_type_preformatted
diff --git a/layout.f90 b/layout.f90
index 41b6d56..68badef 100644
--- a/layout.f90
+++ b/layout.f90
@@ -55,6 +55,7 @@ contains
call rendering_engine%prepare_for_layout()
do while(laying_out)
+
if(.not. associated(walker%breaks)) then
select case (walker%line_type)
diff --git a/main.F90 b/main.F90
index 90a6669..c50d511 100644
--- a/main.F90
+++ b/main.F90
@@ -127,7 +127,7 @@ implicit none
current_url = " "
first_line => null()
- open(unit=io, form="formatted", status="scratch", access='stream')
+ open(unit=io, form="formatted", file="/tmp/scratch", access='stream')
do while(running)
diff --git a/render.f90 b/render.f90
index f5c1358..bc77c4d 100644
--- a/render.f90
+++ b/render.f90
@@ -410,6 +410,7 @@ contains
allocate(breaks(1))
breaks(1) = len_trim(text)
+
do while(r%preformatted_width(text(1:breaks(1))) > r%max_width)
breaks(1) = breaks(1) - 1
end do
@@ -440,7 +441,8 @@ contains
startpos = get_start_position_and_type(text, proportional_type)
endpos = wrap_line(r, text, startpos, proportional_type)
- do while(endpos > startpos)
+
+ do while(endpos >= startpos)
! Save this break
break_count = break_count + 1
@@ -521,7 +523,7 @@ contains
endpos = len_trim(text)
end if
- do while(endpos > startpos)
+ do while(endpos >= startpos)
if(r%is_text_visible(text(startpos:endpos))) then
call r%draw_proportional(text(startpos:endpos), &
text_type=proportional_type)