bugfix in changing shape mid-stroke
This commit is contained in:
parent
35f81e5139
commit
92eccaea5a
|
@ -185,7 +185,7 @@ function test_draw_circle_mid_stroke()
|
||||||
-- draw a circle
|
-- draw a circle
|
||||||
App.mouse_move(Editor_state.left+4, Editor_state.top+Drawing_padding_top+4) -- hover on drawing
|
App.mouse_move(Editor_state.left+4, Editor_state.top+Drawing_padding_top+4) -- hover on drawing
|
||||||
edit.run_after_mouse_press(Editor_state, Editor_state.left+35, Editor_state.top+Drawing_padding_top+36, 1)
|
edit.run_after_mouse_press(Editor_state, Editor_state.left+35, Editor_state.top+Drawing_padding_top+36, 1)
|
||||||
edit.run_after_keychord(Editor_state, 'o')
|
edit.run_after_textinput(Editor_state, 'o')
|
||||||
edit.run_after_mouse_release(Editor_state, Editor_state.left+35+30, Editor_state.top+Drawing_padding_top+36, 1)
|
edit.run_after_mouse_release(Editor_state, Editor_state.left+35+30, Editor_state.top+Drawing_padding_top+36, 1)
|
||||||
local drawing = Editor_state.lines[1]
|
local drawing = Editor_state.lines[1]
|
||||||
check_eq(#drawing.shapes, 1, 'F - test_draw_circle_mid_stroke/#shapes')
|
check_eq(#drawing.shapes, 1, 'F - test_draw_circle_mid_stroke/#shapes')
|
||||||
|
|
7
edit.lua
7
edit.lua
|
@ -289,8 +289,11 @@ function edit.textinput(State, t)
|
||||||
p.name = p.name..t
|
p.name = p.name..t
|
||||||
record_undo_event(State, {before=before, after=snapshot(State, State.lines.current_drawing_index)})
|
record_undo_event(State, {before=before, after=snapshot(State, State.lines.current_drawing_index)})
|
||||||
else
|
else
|
||||||
for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll
|
local drawing_index, drawing = Drawing.current_drawing(State)
|
||||||
Text.textinput(State, t)
|
if drawing_index == nil then
|
||||||
|
for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll
|
||||||
|
Text.textinput(State, t)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
schedule_save(State)
|
schedule_save(State)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user