fix lint errors

This commit is contained in:
DD 2017-08-29 17:24:40 -04:00
parent ad5df04f1e
commit 2c64c45101
5 changed files with 15 additions and 16 deletions

View file

@ -64,7 +64,7 @@ class Blobbiness {
this.tool.onMouseDown = function (event) {
blob.resizeCursorIfNeeded(event.point);
if (event.event.button > 0) return; // only first mouse button
if (event.event.button > 0) return; // only first mouse button
if (blob.options.brushSize < Blobbiness.THRESHOLD) {
blob.brush = Blobbiness.BROAD;
@ -80,7 +80,7 @@ class Blobbiness {
this.tool.onMouseDrag = function (event) {
blob.resizeCursorIfNeeded(event.point);
if (event.event.button > 0) return; // only first mouse button
if (event.event.button > 0) return; // only first mouse button
if (blob.brush === Blobbiness.BROAD) {
blob.broadBrushHelper.onBroadMouseDrag(event, blob.tool, blob.options);
} else if (blob.brush === Blobbiness.SEGMENT) {
@ -96,7 +96,7 @@ class Blobbiness {
this.tool.onMouseUp = function (event) {
blob.resizeCursorIfNeeded(event.point);
if (event.event.button > 0) return; // only first mouse button
if (event.event.button > 0) return; // only first mouse button
let lastPath;
if (blob.brush === Blobbiness.BROAD) {

View file

@ -22,7 +22,7 @@ class BroadBrushHelper {
onBroadMouseDown (event, tool, options) {
tool.minDistance = options.brushSize / 2;
tool.maxDistance = options.brushSize;
if (event.event.button > 0) return; // only first mouse button
if (event.event.button > 0) return; // only first mouse button
this.finalPath = new paper.Path();
stylePath(this.finalPath, options.isEraser);

View file

@ -22,7 +22,7 @@ class SegmentBrushHelper {
}
onSegmentMouseDown (event, tool, options) {
if (event.event.button > 0) return; // only first mouse button
if (event.event.button > 0) return; // only first mouse button
tool.minDistance = 1;
tool.maxDistance = options.brushSize;
@ -37,7 +37,7 @@ class SegmentBrushHelper {
}
onSegmentMouseDrag (event, tool, options) {
if (event.event.button > 0) return; // only first mouse button
if (event.event.button > 0) return; // only first mouse button
const step = (event.delta).normalize(options.brushSize / 2);
const handleVec = step.clone();
@ -75,7 +75,7 @@ class SegmentBrushHelper {
}
onSegmentMouseUp (event) {
if (event.event.button > 0) return; // only first mouse button
if (event.event.button > 0) return; // only first mouse button
// TODO: This smoothing tends to cut off large portions of the path! Would like to eventually
// add back smoothing, maybe a custom implementation that only applies to a subset of the line?

View file

@ -19,6 +19,6 @@ test('changeMode', () => {
test('invalidChangeMode', () => {
expect(reducer(Modes.BRUSH /* state */, changeMode('non-existant mode') /* action */))
.toBe(Modes.BRUSH);
.toBe(Modes.BRUSH);
expect(reducer(Modes.BRUSH /* state */, changeMode() /* action */)).toBe(Modes.BRUSH);
});

View file

@ -1,4 +1,3 @@
const defaultsDeep = require('lodash.defaultsdeep');
const path = require('path');
const webpack = require('webpack');
@ -53,12 +52,12 @@ const base = {
}]
},
plugins: []
.concat(process.env.NODE_ENV === 'production' ? [
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
minimize: true
})
] : [])
.concat(process.env.NODE_ENV === 'production' ? [
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
minimize: true
})
] : [])
};
module.exports = [
@ -96,7 +95,7 @@ module.exports = [
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
libraryTarget: 'commonjs2',
libraryTarget: 'commonjs2'
}
})
];