several bugfixes
All introduced when I built rectangles and squares in commit e27165cb
.
This commit is contained in:
parent
10c961855a
commit
5d8e7a3cc6
|
@ -171,6 +171,8 @@ function Drawing.draw_pending_shape(left,top, drawing)
|
||||||
shape.end_angle = geom.angle_with_hint(center.x,center.y, mx,my, shape.end_angle)
|
shape.end_angle = geom.angle_with_hint(center.x,center.y, mx,my, shape.end_angle)
|
||||||
local cx,cy = Drawing.pixels(center.x)+left, Drawing.pixels(center.y)+top
|
local cx,cy = Drawing.pixels(center.x)+left, Drawing.pixels(center.y)+top
|
||||||
love.graphics.arc('line', 'open', cx,cy, Drawing.pixels(shape.radius), shape.start_angle, shape.end_angle, 360)
|
love.graphics.arc('line', 'open', cx,cy, Drawing.pixels(shape.radius), shape.start_angle, shape.end_angle, 360)
|
||||||
|
elseif shape.mode == 'move' then
|
||||||
|
-- nothing pending; changes are immediately committed
|
||||||
else
|
else
|
||||||
print(shape.mode)
|
print(shape.mode)
|
||||||
assert(false)
|
assert(false)
|
||||||
|
@ -195,6 +197,8 @@ function Drawing.mouse_pressed(drawing, x,y, button)
|
||||||
elseif Current_drawing_mode == 'circle' then
|
elseif Current_drawing_mode == 'circle' then
|
||||||
local j = Drawing.insert_point(drawing.points, Drawing.coord(x-16), Drawing.coord(y-drawing.y))
|
local j = Drawing.insert_point(drawing.points, Drawing.coord(x-16), Drawing.coord(y-drawing.y))
|
||||||
drawing.pending = {mode=Current_drawing_mode, center=j}
|
drawing.pending = {mode=Current_drawing_mode, center=j}
|
||||||
|
elseif Current_drawing_mode == 'move' then
|
||||||
|
-- all the action is in mouse_released
|
||||||
else
|
else
|
||||||
print(Current_drawing_mode)
|
print(Current_drawing_mode)
|
||||||
assert(false)
|
assert(false)
|
||||||
|
@ -225,8 +229,7 @@ function Drawing.update()
|
||||||
drawing.pending.target_point.y = my
|
drawing.pending.target_point.y = my
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
print(Current_drawing_mode)
|
-- do nothing
|
||||||
assert(false)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,10 @@ backspace
|
||||||
cursor_pos == 0, previous line is a drawing -> delete drawing, cursor still visible at start of line
|
cursor_pos == 0, previous line is a drawing -> delete drawing, cursor still visible at start of line
|
||||||
cursor_pos == 0, previous line is text -> join lines, cursor still at same character
|
cursor_pos == 0, previous line is text -> join lines, cursor still at same character
|
||||||
|
|
||||||
|
drawing
|
||||||
|
draw a line, circle, rectangle, square, polygon
|
||||||
|
select a point and move it
|
||||||
|
|
||||||
enter
|
enter
|
||||||
cursor_pos == 0 -> insert empty line above current line
|
cursor_pos == 0 -> insert empty line above current line
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue