This commit is contained in:
Jeff Wofford 2021-07-25 22:15:43 -03:00 committed by GitHub
commit 6b725bfc98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11351 additions and 0 deletions

11340
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -11,6 +11,11 @@
this.toolId = 'tool-dithering';
this.helpText = 'Dithering tool';
this.shortcut = pskl.service.keyboard.Shortcuts.TOOL.DITHERING;
this.tooltipDescriptors = [
{key : 'ctrl', description : 'Use 25% dither'},
{key : 'shift', description : 'Use 75% dither'},
];
};
pskl.utils.inherit(ns.DitheringTool, ns.SimplePen);
@ -36,6 +41,12 @@
ns.DitheringTool.prototype.applyToolOnPixel = function(col, row, frame, overlay, event) {
var usePrimaryColor = (col + row) % 2;
if (pskl.utils.UserAgent.isMac ? event.metaKey : event.ctrlKey) {
usePrimaryColor = col % 2 || row % 2;
} else if (event.shiftKey) {
usePrimaryColor = col % 2 && row % 2;
}
if (pskl.app.mouseStateService.isRightButtonPressed()) {
usePrimaryColor = !usePrimaryColor;
}