use available variables

This commit is contained in:
Kartik K. Agaram 2022-07-13 08:19:58 -07:00
parent 5017659bf4
commit 3b1f2cf9de
1 changed files with 1 additions and 1 deletions

View File

@ -245,7 +245,7 @@ function Drawing.update(State)
if App.mouse_down(1) then
if Drawing.in_drawing(drawing, pmx,pmy, State.left,State.right) then
if drawing.pending.mode == 'freehand' then
table.insert(drawing.pending.points, {x=Drawing.coord(App.mouse_x()-State.left, State.width), y=Drawing.coord(App.mouse_y()-drawing.y, State.width)})
table.insert(drawing.pending.points, {x=Drawing.coord(pmx-State.left, State.width), y=Drawing.coord(pmy-drawing.y, State.width)})
elseif drawing.pending.mode == 'move' then
local mx,my = Drawing.coord(pmx-State.left, State.width), Drawing.coord(pmy-drawing.y, State.width)
drawing.pending.target_point.x = mx