address review comments

develop
myk002 2021-01-12 23:27:14 -08:00
parent 97309e45f5
commit d4fbf4261f
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
1 changed files with 4 additions and 6 deletions

@ -234,11 +234,10 @@ end
function render_text(obj,dc,x0,y0,pen,dpen,disabled) function render_text(obj,dc,x0,y0,pen,dpen,disabled)
local width = 0 local width = 0
for iline,line in ipairs(obj.text_lines) do -- note that lines outside of the containing frame are not displayed, so
if dc and obj.start_line_num and iline < obj.start_line_num then -- we only have to bound the start condition, not the end condition
goto continue for iline = dc and obj.start_line_num or 1, #obj.text_lines do
end local x, line = 0, obj.text_lines[iline]
local x = 0
if dc then if dc then
local offset = (obj.start_line_num or 1) - 1 local offset = (obj.start_line_num or 1) - 1
dc:seek(x+x0,y0+iline-offset-1) dc:seek(x+x0,y0+iline-offset-1)
@ -327,7 +326,6 @@ function render_text(obj,dc,x0,y0,pen,dpen,disabled)
token.x2 = x token.x2 = x
end end
width = math.max(width, x) width = math.max(width, x)
::continue::
end end
obj.text_width = width obj.text_width = width
end end