about summary refs log tree commit diff stats
path: root/main.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-05-19 22:02:18 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-05-19 22:02:18 -0700
commit6e89f6c63f9ed24cbf5a85f7b170ebfd1c8a175a (patch)
tree8f94385cc919a34c76e72e52e137f7c169dc0067 /main.lua
parentc9e69530a0cea5f43ef009b09cf54b039e122dfe (diff)
downloadtext.love-6e89f6c63f9ed24cbf5a85f7b170ebfd1c8a175a.tar.gz
make text and drawings the same width
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/main.lua b/main.lua
index 8e3641c..d058e53 100644
--- a/main.lua
+++ b/main.lua
@@ -46,9 +46,7 @@ Screen_width, Screen_height, Screen_flags = 0, 0, nil
 Current_drawing_mode = 'line'
 Previous_drawing_mode = nil
 
--- All drawings span 100% of some conceptual 'page width' and divide it up
--- into 256 parts. `Drawing_width` describes their width in pixels.
-Drawing_width = nil  -- pixels
+Line_width = nil  -- maximum width available to either text or drawings, in pixels
 
 Zoom = 1.5
 
@@ -63,7 +61,7 @@ function love.load(arg)
   Screen_height = Screen_height-100
   love.window.setMode(Screen_width, Screen_height)
   love.window.setTitle('Text with Lines')
-  Drawing_width = math.floor(Screen_width/2/40)*40
+  Line_width = math.floor(Screen_width/2/40)*40
   love.keyboard.setTextInput(true)  -- bring up keyboard on touch screen
   love.keyboard.setKeyRepeat(true)
   if #arg > 0 then
@@ -129,7 +127,7 @@ function love.draw()
       else
         line.y = y
 --?         y = Text.draw(line, 100, line_index, Cursor_line, Cursor_pos)
-        y = Text.draw(line, Drawing_width, line_index, Cursor_line, Cursor_pos)
+        y = Text.draw(line, Line_width, line_index, Cursor_line, Cursor_pos)
         y = y + math.floor(15*Zoom)  -- text height
       end
     end