about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--Manual_tests.md3
-rw-r--r--edit.lua4
2 files changed, 5 insertions, 2 deletions
diff --git a/Manual_tests.md b/Manual_tests.md
index 358ea8b..cde027f 100644
--- a/Manual_tests.md
+++ b/Manual_tests.md
@@ -46,6 +46,9 @@ Lua is dynamically typed. Tests can't patch over lack of type-checking.
 * Like any high-level language, it's easy to accidentally alias two non-scalar
   variables. I wish there was a way to require copy when assigning.
 
+* I wish I could require pixel coordinates to integers. The editor defensively
+  converts input margins to integers.
+
 * My test harness automatically runs `test_*` methods -- but only at the
   top-level. I wish there was a way to raise warnings if someone defines such
   a function inside a dict somewhere.
diff --git a/edit.lua b/edit.lua
index 0a30c77..4945529 100644
--- a/edit.lua
+++ b/edit.lua
@@ -90,8 +90,8 @@ function edit.initialize_state(top, left, right, font_height, line_height)  -- c
     em = App.newText(love.graphics.getFont(), 'm'),  -- widest possible character width
 
     top = top,
-    left = left,
-    right = right,
+    left = math.floor(left),
+    right = math.floor(right),
     width = right-left,
 
     filename = love.filesystem.getUserDirectory()..'/lines.txt',  -- '/' should work even on Windows