|
|
@ -366,17 +366,24 @@ function handle_event(state, context, event, options = {}) { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} else if (other_event.type === EVENT.UNDO) { |
|
|
|
} else if (other_event.type === EVENT.UNDO) { |
|
|
|
// do not undo an undo, we are not Notepad
|
|
|
|
// do not undo an undo, we are not Notepad
|
|
|
|
|
|
|
|
} else if (other_event.type === EVENT.IMAGE) { |
|
|
|
|
|
|
|
console.log('TODO: undo image'); |
|
|
|
} else if (other_event.type === EVENT.IMAGE_MOVE) { |
|
|
|
} else if (other_event.type === EVENT.IMAGE_MOVE) { |
|
|
|
// TODO
|
|
|
|
// TODO
|
|
|
|
console.log('TODO: undo image scale'); |
|
|
|
console.log('TODO: undo image move'); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} else if (other_event.type === EVENT.IMAGE_SCALE) { |
|
|
|
} else if (other_event.type === EVENT.IMAGE_SCALE) { |
|
|
|
// TODO
|
|
|
|
// TODO
|
|
|
|
console.log('TODO: undo image scale'); |
|
|
|
console.log('TODO: undo image scale'); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} else if (other_event.type === EVENT.ERASER) { |
|
|
|
} else if (other_event.type === EVENT.ERASER) { |
|
|
|
// TODO
|
|
|
|
const stroke = state.events[other_event.stroke_id]; |
|
|
|
console.log('TODO: undo eraser'); |
|
|
|
stroke.deleted = false; |
|
|
|
|
|
|
|
if (!options.skip_bvh) { |
|
|
|
|
|
|
|
bvh_undelete_stroke(state, stroke); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
need_draw = true; |
|
|
|
|
|
|
|
other_event.deleted = true; |
|
|
|
break; |
|
|
|
break; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
console.error('cant undo event type', other_event.type); |
|
|
|
console.error('cant undo event type', other_event.type); |
|
|
|