no, bring back that defense

Scenario where I ran into it:
  start a stroke inside a drawing
  press 'o' to switch to circle mode (but any mode switch will do)

The problem is that Text.textinput unconditionally blows away all .y
values. Sometimes we have to wait for a draw() to fill them back in.
This commit is contained in:
Kartik K. Agaram 2022-07-13 09:21:19 -07:00
parent 22ad5373c5
commit d231f4d37d

View File

@ -241,6 +241,10 @@ function Drawing.update(State)
if State.lines.current_drawing == nil then return end
local drawing = State.lines.current_drawing
assert(drawing.mode == 'drawing')
if drawing.y == nil then
-- something invalidated all the y's; just wait for a draw
return
end
local pmx, pmy = App.mouse_x(), App.mouse_y()
local mx = Drawing.coord(pmx-State.left, State.width)
local my = Drawing.coord(pmy-drawing.y, State.width)