diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-07-12 21:38:29 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-07-12 21:41:09 -0700 |
commit | 307e875c1c7cee60e3a07e3d7bf4f2bf79066d02 (patch) | |
tree | cdedfdcdd1380a0da8aaf5ef3eef847ac1ed0a6c | |
parent | 3dd5413dbf4f7e875195a1caf22635302205f799 (diff) | |
download | view.love-307e875c1c7cee60e3a07e3d7bf4f2bf79066d02.tar.gz |
correct a mis-named threshold
-rw-r--r-- | drawing.lua | 4 | ||||
-rw-r--r-- | edit.lua | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/drawing.lua b/drawing.lua index d1947ab..992495e 100644 --- a/drawing.lua +++ b/drawing.lua @@ -41,7 +41,7 @@ function Drawing.draw(State, line) if p.deleted == nil then if Drawing.near(p, mx,my) then App.color(Focus_stroke_color) - love.graphics.circle('line', Drawing.pixels(p.x)+State.left,Drawing.pixels(p.y)+line.y, 4) + love.graphics.circle('line', Drawing.pixels(p.x)+State.left,Drawing.pixels(p.y)+line.y, Same_point_distance) else App.color(Stroke_color) love.graphics.circle('fill', Drawing.pixels(p.x)+State.left,Drawing.pixels(p.y)+line.y, 2) @@ -706,7 +706,7 @@ end function Drawing.near(point, x,y) local px,py = Drawing.pixels(x),Drawing.pixels(y) local cx,cy = Drawing.pixels(point.x), Drawing.pixels(point.y) - return (cx-px)*(cx-px) + (cy-py)*(cy-py) < Editor_state.left + return (cx-px)*(cx-px) + (cy-py)*(cy-py) < Same_point_distance*Same_point_distance end function Drawing.pixels(n) -- parts to pixels diff --git a/edit.lua b/edit.lua index d022ac1..f4285b2 100644 --- a/edit.lua +++ b/edit.lua @@ -14,6 +14,8 @@ Margin_top = 15 Margin_left = 25 Margin_right = 25 +Same_point_distance = 4 -- pixel distance at which two points are considered the same + utf8 = require 'utf8' require 'file' |