Improved interface response.

This commit is contained in:
Devine Lu Linvega 2018-10-04 16:24:28 +12:00
parent a10232ede0
commit 2feaec6c0a
2 changed files with 7 additions and 1 deletions

View File

@ -26,7 +26,7 @@
</head>
<body>
<script>
'use strict';
'use strict'
const webFrame = require('electron').webFrame
const {dialog,app} = require('electron').remote;
@ -52,6 +52,7 @@
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");
dotgrid.controller.add("default","Edit","Redo",() => { dotgrid.tool.clear() },"Escape");
dotgrid.controller.add("default","Stroke","Line",() => { dotgrid.tool.cast("line"); },"A");
dotgrid.controller.add("default","Stroke","Arc",() => { dotgrid.tool.cast("arc_c"); },"S"); // 0,1

View File

@ -71,16 +71,20 @@ function Interface () {
this.over = function (type, name) {
dotgrid.cursor.operation = {}
dotgrid.cursor.operation[type] = name
this.update(true)
dotgrid.guide.update(true);
}
this.out = function (type, name) {
dotgrid.cursor.operation = ''
dotgrid.guide.update(true)
}
this.up = function (type, name) {
if (!dotgrid.tool[type]) { console.warn(`Unknown option(type): ${type}.${name}`, dotgrid.tool); return }
this.update(true)
dotgrid.guide.update(true)
}
this.down = function (type, name) {
@ -88,6 +92,7 @@ function Interface () {
dotgrid.tool[type](name)
this.update(true)
dotgrid.guide.update(true);
}
this.prev_operation = null