From be2b69c7230fb4bd0e38ac5c6c7138b59c61e620 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sat, 20 Jan 2018 09:54:44 +1300 Subject: [PATCH] Can now hide control points. --- LAYOUT.svg | 2 +- main.js | 2 +- package.json | 8 ++------ sources/scripts/dotgrid.js | 1 + sources/scripts/guide.js | 5 +++++ 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/LAYOUT.svg b/LAYOUT.svg index 9f1d0e4..dbd2198 100644 --- a/LAYOUT.svg +++ b/LAYOUT.svg @@ -1 +1 @@ -ESCDESELECTDOCUMENT1234567890-+BACKSPACEDELETERESETTABQQUITWERTYUIOOPENP[THINNER]THICKER|CAPSALINESARCSAVEDARC REVFBEZIERGFILLHGRIDHIDEJKL;TOOLS'ENTERINSERTFULLSCRESHIFTZCONNECTUNDOXCCOPYVPASTEBNNEWM,ABOUT.INSPECT/LINECAPCAPSLOCKCTRLCMDALTSPACEMIRRORCTRLPNFNALT \ No newline at end of file +ESCDESELECTDOCUMENT1234567890-+BACKSPACEDELETERESETTABQQUITWERTYUIOOPENP[THINNER]THICKER|CAPSALINESARCSAVEDARC REVFBEZIERGFILLHGRIDHIDEJCONTROLKL;TOOLS'ENTERINSERTFULLSCRESHIFTZCONNECTUNDOXCCOPYVPASTEBNNEWM,ABOUT.INSPECT/LINECAPCAPSLOCKCTRLCMDALTSPACEMIRRORCTRLPNFNALT \ No newline at end of file diff --git a/main.js b/main.js index 25f5413..00eab11 100644 --- a/main.js +++ b/main.js @@ -29,7 +29,7 @@ app.win = null; app.on('ready', () => { - app.win = new BrowserWindow({width: 400, height: 420, minWidth: 400, minHeight: 400, backgroundColor:"#000", frame:false, autoHideMenuBar: true, icon: __dirname + '/icon.ico'}) + 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`); diff --git a/package.json b/package.json index 5d649da..9ab33fd 100644 --- a/package.json +++ b/package.json @@ -12,13 +12,9 @@ "push_osx" : "~/butler push ~/Desktop/Dotgrid-darwin-x64/ hundredrabbits/dotgrid:osx-64", "push_linux" : "~/butler push ~/Desktop/Dotgrid-linux-x64/ hundredrabbits/dotgrid:linux-64", "push_win" : "~/butler push ~/Desktop/Dotgrid-win32-x64/ hundredrabbits/dotgrid:windows-64", + "push_theme" : "~/butler push ~/Github/HundredRabbits/Themes/themes/ hundredrabbits/dotgrid:themes", "push_status" : "~/butler status hundredrabbits/dotgrid", - "theme" : "npm run theme_osx ; npm run theme_linux ; npm run theme_win", - "theme_osx" : "cp -R ~/Github/HundredRabbits/Themes/themes ~/Desktop/Dotgrid-darwin-x64/", - "theme_linux" : "cp -R ~/Github/HundredRabbits/Themes/themes ~/Desktop/Dotgrid-linux-x64/", - "theme_win" : "cp -R ~/Github/HundredRabbits/Themes/themes ~/Desktop/Dotgrid-win32-x64/", - "docs" : "electron . docs", - "push" : "npm run build ; npm run theme ; npm run push_osx ; npm run push_linux ; npm run push_win ; npm run clean ; npm run push_status" + "push" : "npm run build ; npm run push_theme ; npm run push_osx ; npm run push_linux ; npm run push_win ; npm run clean ; npm run push_status" }, "devDependencies": { "electron": "^1.8.1" diff --git a/sources/scripts/dotgrid.js b/sources/scripts/dotgrid.js index 8412197..e532dbb 100644 --- a/sources/scripts/dotgrid.js +++ b/sources/scripts/dotgrid.js @@ -163,6 +163,7 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca this.controller.add("default","View","Tools",() => { dotgrid.interface.toggle(); },";"); this.controller.add("default","View","Grid",() => { dotgrid.guide.toggle(); },"H"); + this.controller.add("default","View","Control Points",() => { dotgrid.guide.toggle_widgets(); },"J"); this.controller.add("default","View","Expert",() => { dotgrid.interface.toggle_zoom(); },":"); this.controller.commit(); diff --git a/sources/scripts/guide.js b/sources/scripts/guide.js index 4ab2da2..084f181 100644 --- a/sources/scripts/guide.js +++ b/sources/scripts/guide.js @@ -25,6 +25,11 @@ function Guide() this.el.style.opacity = !this.el.style.opacity || this.el.style.opacity == 1 ? 0 : 1; } + this.toggle_widgets = function() + { + this.widgets.style.opacity = !this.widgets.style.opacity || this.widgets.style.opacity == 1 ? 0 : 1; + } + this.draw = function() { for (var x = dotgrid.grid_x; x >= 0; x--) {