diff --git a/main.js b/main.js index aefd8ad..d5e2c66 100644 --- a/main.js +++ b/main.js @@ -32,7 +32,6 @@ app.on('ready', () => app.win = new BrowserWindow({width: 400, height: 420, minWidth: 400, minHeight: 420, backgroundColor:"#000", frame:false, autoHideMenuBar: true, icon: __dirname + '/icon.ico'}) app.win.loadURL(`file://${__dirname}/sources/index.html`); - app.win.toggleDevTools(); app.win.on('closed', () => { win = null diff --git a/sources/scripts/dotgrid.js b/sources/scripts/dotgrid.js index 32ecb7a..db9c172 100644 --- a/sources/scripts/dotgrid.js +++ b/sources/scripts/dotgrid.js @@ -153,6 +153,7 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca document.addEventListener('mousedown', function(e){ dotgrid.mouse_down(e); }, false); document.addEventListener('mousemove', function(e){ dotgrid.mouse_move(e); }, false); + document.addEventListener('contextmenu', function(e){ dotgrid.mouse_alt(e); }, false); document.addEventListener('mouseup', function(e){ dotgrid.mouse_up(e);}, false); document.addEventListener('copy', function(e){ dotgrid.copy(e); e.preventDefault(); }, false); document.addEventListener('paste', function(e){ dotgrid.paste(e); e.preventDefault(); }, false); @@ -260,6 +261,13 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca this.draw(); } + this.mouse_alt = function(e) + { + var pos = this.position_in_grid(new Pos(e.clientX+5,e.clientY-5)); pos = this.position_on_grid(pos); + dotgrid.tool.remove_segments_at(pos); + this.draw(); + } + this.move_cursor = function(pos) { if(pos.x>0) {