clean up
This commit is contained in:
parent
0248339898
commit
97bbc7da7f
|
@ -66,9 +66,6 @@ found anything amiss: http://akkartik.name/contact
|
||||||
|
|
||||||
## Known issues
|
## Known issues
|
||||||
|
|
||||||
* There's a bug in freehand drawings (`ctrl+p` mode) that causes them to be
|
|
||||||
highlighted even when the mouse is nowhere near them.
|
|
||||||
|
|
||||||
* No support yet for Unicode graphemes spanning multiple codepoints.
|
* No support yet for Unicode graphemes spanning multiple codepoints.
|
||||||
|
|
||||||
* Undo/redo may be sluggish in large files. Large files may grow sluggish in
|
* Undo/redo may be sluggish in large files. Large files may grow sluggish in
|
||||||
|
|
17
drawing.lua
17
drawing.lua
|
@ -4,8 +4,6 @@ geom = require 'geom'
|
||||||
|
|
||||||
require 'drawing_tests'
|
require 'drawing_tests'
|
||||||
|
|
||||||
Show_nearby = false
|
|
||||||
|
|
||||||
-- All drawings span 100% of some conceptual 'page width' and divide it up
|
-- All drawings span 100% of some conceptual 'page width' and divide it up
|
||||||
-- into 256 parts.
|
-- into 256 parts.
|
||||||
function Drawing.draw(line)
|
function Drawing.draw(line)
|
||||||
|
@ -30,17 +28,6 @@ function Drawing.draw(line)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if Show_nearby then
|
|
||||||
love.graphics.setColor(1,0.75,0.75)
|
|
||||||
for y=0,127 do
|
|
||||||
for x=0,255 do
|
|
||||||
if geom.on_any_shape(x,y, line) then
|
|
||||||
love.graphics.circle('fill', Drawing.pixels(x)+Margin_left, Drawing.pixels(y)+line.y, 2)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local mx,my = Drawing.coord(pmx-Margin_left), Drawing.coord(pmy-line.y)
|
local mx,my = Drawing.coord(pmx-Margin_left), Drawing.coord(pmy-line.y)
|
||||||
|
|
||||||
for _,shape in ipairs(line.shapes) do
|
for _,shape in ipairs(line.shapes) do
|
||||||
|
@ -383,10 +370,6 @@ function Drawing.mouse_released(x,y, button)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Drawing.keychord_pressed(chord)
|
function Drawing.keychord_pressed(chord)
|
||||||
if chord == 'C-a' then
|
|
||||||
Show_nearby = not Show_nearby
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if chord == 'C-p' and not App.mouse_down(1) then
|
if chord == 'C-p' and not App.mouse_down(1) then
|
||||||
Current_drawing_mode = 'freehand'
|
Current_drawing_mode = 'freehand'
|
||||||
elseif App.mouse_down(1) and chord == 'l' then
|
elseif App.mouse_down(1) and chord == 'l' then
|
||||||
|
|
10
geom.lua
10
geom.lua
|
@ -1,15 +1,5 @@
|
||||||
local geom = {}
|
local geom = {}
|
||||||
|
|
||||||
function geom.on_any_shape(x,y, drawing)
|
|
||||||
for _,shape in ipairs(drawing.shapes) do
|
|
||||||
assert(shape)
|
|
||||||
if geom.on_shape(x,y, drawing, shape) then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
function geom.on_shape(x,y, drawing, shape)
|
function geom.on_shape(x,y, drawing, shape)
|
||||||
if shape.mode == 'freehand' then
|
if shape.mode == 'freehand' then
|
||||||
return geom.on_freehand(x,y, drawing, shape)
|
return geom.on_freehand(x,y, drawing, shape)
|
||||||
|
|
Loading…
Reference in New Issue