|
|
|
@ -364,7 +364,7 @@ function handle_event(state, context, event, options = {}) {
@@ -364,7 +364,7 @@ function handle_event(state, context, event, options = {}) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
case EVENT.UNDO: { |
|
|
|
|
geometry_add_dummy_stroke(context); |
|
|
|
|
geometry_add_dummy_stroke(state, context); |
|
|
|
|
need_draw = undo(state, context, event, options); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
@ -372,7 +372,7 @@ function handle_event(state, context, event, options = {}) {
@@ -372,7 +372,7 @@ function handle_event(state, context, event, options = {}) {
|
|
|
|
|
case EVENT.IMAGE: { |
|
|
|
|
const p = {'x': event.x, 'y': event.y}; |
|
|
|
|
|
|
|
|
|
geometry_add_dummy_stroke(context); |
|
|
|
|
geometry_add_dummy_stroke(state, context); |
|
|
|
|
add_image(context, event.image_id, null, p, event.width, event.height); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
@ -401,7 +401,7 @@ function handle_event(state, context, event, options = {}) {
@@ -401,7 +401,7 @@ function handle_event(state, context, event, options = {}) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
case EVENT.IMAGE_MOVE: { |
|
|
|
|
geometry_add_dummy_stroke(context); |
|
|
|
|
geometry_add_dummy_stroke(state, context); |
|
|
|
|
const image_id = event.image_id; |
|
|
|
|
const image = get_image(context, image_id); |
|
|
|
|
|
|
|
|
@ -415,7 +415,7 @@ function handle_event(state, context, event, options = {}) {
@@ -415,7 +415,7 @@ function handle_event(state, context, event, options = {}) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
case EVENT.IMAGE_SCALE: { |
|
|
|
|
geometry_add_dummy_stroke(context); |
|
|
|
|
geometry_add_dummy_stroke(state, context); |
|
|
|
|
const image_id = event.image_id; |
|
|
|
|
const image = get_image(context, image_id); |
|
|
|
|
|
|
|
|
@ -428,7 +428,7 @@ function handle_event(state, context, event, options = {}) {
@@ -428,7 +428,7 @@ function handle_event(state, context, event, options = {}) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
case EVENT.ERASER: { |
|
|
|
|
geometry_add_dummy_stroke(context); |
|
|
|
|
geometry_add_dummy_stroke(state, context); |
|
|
|
|
need_draw = true; |
|
|
|
|
const stroke = state.events[event.stroke_id]; |
|
|
|
|
stroke.deleted = true; |
|
|
|
|