Added cut

This commit is contained in:
Devine Lu Linvega 2018-11-21 20:11:27 +12:00
parent 8761be0805
commit 9d033b9277
2 changed files with 2 additions and 0 deletions

View File

@ -48,6 +48,7 @@
DOTGRID.controller.add("default","File","Export(.svg)",() => { DOTGRID.export(); },"CmdOrCtrl+E");
DOTGRID.controller.add_role("default","Edit","copy");
DOTGRID.controller.add_role("default","Edit","cut");
DOTGRID.controller.add_role("default","Edit","paste");
DOTGRID.controller.add("default","Edit","Undo",() => { DOTGRID.tool.undo() },"CmdOrCtrl+Z");
DOTGRID.controller.add("default","Edit","Redo",() => { DOTGRID.tool.redo() },"CmdOrCtrl+Shift+Z");

View File

@ -209,6 +209,7 @@ function Dotgrid (width, height, grid_x, grid_y, block_x, block_y) {
DOTGRID.guide.update()
if (e.target !== this.picker.input) {
e.clipboardData.setData('text/source', DOTGRID.tool.export(DOTGRID.tool.layer()))
e.clipboardData.setData('text/plain', DOTGRID.tool.export(DOTGRID.tool.layer()))
e.clipboardData.setData('text/html', DOTGRID.renderer.svg_el.outerHTML)
e.clipboardData.setData('text/svg+xml', DOTGRID.renderer.svg_el.outerHTML)