about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-03-25 18:34:28 -0700
committerKartik K. Agaram <vc@akkartik.com>2023-03-25 18:34:28 -0700
commit57ed70d9125a45c819302c23445732b1acc14e8f (patch)
treeccd275f88da1ad55475abcafadf968a4906452cc
parentda932ce92dcf5930d3224c2179db41cf024f5169 (diff)
downloadtext.love-57ed70d9125a45c819302c23445732b1acc14e8f.tar.gz
clean up some absolute coordinates
-rw-r--r--edit.lua2
-rw-r--r--icons.lua4
2 files changed, 3 insertions, 3 deletions
diff --git a/edit.lua b/edit.lua
index b894dde..2b405a7 100644
--- a/edit.lua
+++ b/edit.lua
@@ -168,7 +168,7 @@ function edit.draw(State)
       end
       if line.data == '' then
         -- button to insert new drawing
-        button(State, 'draw', {x=4,y=y+4, w=12,h=12, color={1,1,0},
+        button(State, 'draw', {x=State.left-Margin_left+4, y=y+4, w=12,h=12, color={1,1,0},
           icon = icon.insert_drawing,
           onpress1 = function()
                        Drawing.before = snapshot(State, line_index-1, line_index)
diff --git a/icons.lua b/icons.lua
index e80f771..ddad704 100644
--- a/icons.lua
+++ b/icons.lua
@@ -4,8 +4,8 @@ function icon.insert_drawing(button_params)
   local x,y = button_params.x, button_params.y
   App.color(Icon_color)
   love.graphics.rectangle('line', x,y, 12,12)
-  love.graphics.line(4,y+6, 16,y+6)
-  love.graphics.line(10,y, 10,y+12)
+  love.graphics.line(x,y+6, x+12,y+6)
+  love.graphics.line(x+6,y, x+6,y+12)
 end
 
 function icon.hyperlink_decoration(button_params)