about summary refs log tree commit diff stats
path: root/main.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-06-30 19:50:27 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-06-30 19:50:27 -0700
commit8c7bea8f7615f34425742381aea21cd4991f97da (patch)
tree07edb04e1534f758199e44c9e3c5a6fbb9fefaef /main.lua
parent08a50b7fff71324897eeb31a0d323d3444ef105b (diff)
downloadtext.love-8c7bea8f7615f34425742381aea21cd4991f97da.tar.gz
rip out notion of Line_width
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua10
1 files changed, 1 insertions, 9 deletions
diff --git a/main.lua b/main.lua
index df20d60..39c7283 100644
--- a/main.lua
+++ b/main.lua
@@ -111,7 +111,6 @@ function App.initialize(arg)
   end
 
   initialize_font_settings(20)
---?   Line_width = 80
 
   if #arg > 0 then
     Filename = arg[1]
@@ -170,7 +169,6 @@ end
 function App.resize(w, h)
 --?   print(("Window resized to width: %d and height: %d."):format(w, h))
   App.screen.width, App.screen.height = w, h
-  Line_width = math.min(40*App.width(Em), App.screen.width-50)
   Text.redraw_all()
   Last_resize_time = App.getTime()
 end
@@ -181,10 +179,6 @@ function initialize_font_settings(font_height)
   Line_height = math.floor(font_height*1.3)
 
   Em = App.newText(love.graphics.getFont(), 'm')
-
-  -- maximum width available to either text or drawings, in pixels
-  -- readable text width is 50-75 chars
-  Line_width = math.min(40*App.width(Em), App.screen.width-50)
 end
 
 function App.filedropped(file)
@@ -211,8 +205,6 @@ function App.draw()
   Button_handlers = {}
   love.graphics.setColor(1, 1, 1)
   love.graphics.rectangle('fill', 0, 0, App.screen.width-1, App.screen.height-1)
---?   love.graphics.setColor(0, 1, 0)
---?   love.graphics.line(Line_width,0, Line_width,App.screen.height)
   love.graphics.setColor(0, 0, 0)
 
   -- some hysteresis while resizing
@@ -268,7 +260,7 @@ function App.draw()
         if line_index == Screen_top1.line then
           line.startpos = Screen_top1.pos
         end
-        y, Screen_bottom1.pos = Text.draw(line, Line_width, line_index)
+        y, Screen_bottom1.pos = Text.draw(line, line_index)
         y = y + Line_height
 --?         print('=> y', y)
       end