Merge pull request #60 from jkarttunen/master

Resolves #59 - decrease line thickness with right click
This commit is contained in:
Лu Лinveгa 2019-07-31 01:10:45 +12:00 committed by GitHub
commit 9a7149edb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -53,7 +53,7 @@ function Interface (dotgrid) {
title="${name.capitalize()}"
onmouseout="dotgrid.interface.out('${type}','${name}')"
onmouseup="dotgrid.interface.up('${type}','${name}')"
onmousedown="dotgrid.interface.down('${type}','${name}')"
onmousedown="dotgrid.interface.down('${type}','${name}', event)"
onmouseover="dotgrid.interface.over('${type}','${name}')"
viewBox="0 0 300 300"
class="icon ${type}">
@ -87,10 +87,10 @@ function Interface (dotgrid) {
dotgrid.renderer.update(true)
}
this.down = function (type, name) {
this.down = function (type, name, event) {
if (!dotgrid.tool[type]) { console.warn(`Unknown option(type): ${type}.${name}`, dotgrid.tool); return }
dotgrid.tool[type](name)
const mod = event.button == 2 ? -1 : 1;
dotgrid.tool[type](name, mod)
this.update(true)
dotgrid.renderer.update(true)
}