comply with linter

This commit is contained in:
casperlamboo 2017-12-13 17:25:42 +01:00
parent 6dc871c320
commit d45df12f6f
6 changed files with 18 additions and 15 deletions

View File

@ -228,13 +228,13 @@ export function d3ChangeTool(tool) {
export function contextChangeTool(tool) {
return { type: CONTEXT_CHANGE_TOOL, tool };
}
export function heightStart(handle) {
export function changeHeightStart(handle) {
return { type: HEIGHT_START, handle };
}
export function height(delta) {
export function changeHeight(delta) {
return { type: HEIGHT, delta, log: false };
}
export function heightEnd() {
export function changeHeightEnd() {
return { type: HEIGHT_END };
}
export function twistStart() {
@ -378,7 +378,10 @@ export function addImage(file) {
}).catch(error => {
URL.revokeObjectURL(url);
dispatch(notification.error({ position: 'tc', title: 'Error loading image, please try again with another image' }));
dispatch(notification.error({
position: 'tc',
title: 'Error loading image, please try again with another image'
}));
throw error; // rethrow for other listeners
});

View File

@ -78,9 +78,9 @@ class App extends React.Component {
event.preventDefault();
for (const file of event.dataTransfer.files) {
const [name, ...extentions] = file.name.split('.');
const extentions = file.name.split('.').pop();
switch (extentions.pop().toUpperCase()) {
switch (extentions.toUpperCase()) {
case 'D3SKETCH':
case 'JSON':
const url = URL.createObjectURL(file);
@ -130,5 +130,5 @@ export default injectSheet(styles)(connect(null, {
undo: actions.undo.undo,
redo: actions.undo.redo,
openSketch: actions.openSketch,
addImage: actions.addImage,
addImage: actions.addImage
})(App));

View File

@ -62,7 +62,8 @@ class D3Panel extends React.Component {
componentWillMount() {
this.createScene();
this.renderChain = new RenderChain(this.renderer, this.scene, this.camera, hasExtensionsFor.toonShaderPreview, {
const toonShader = hasExtensionsFor.hasExtensionsFor;
this.renderChain = new RenderChain(this.renderer, this.scene, this.camera, toonShader, {
UI: this.UIContainer,
shapes: this.shapesManager,
boundingBox: this.selectionBox,

View File

@ -51,7 +51,6 @@ class DoodlePreview extends React.Component {
if (docData) sketchData = await JSONToSketchData(this.props.docData);
const { canvas } = this.refs;
const { pixelRatio } = this.props
const sceneData = createSceneData(sketchData);
@ -70,7 +69,7 @@ class DoodlePreview extends React.Component {
resizeHandler = (width, height) => {
requestAnimationFrame(() => {
const { setSize, render } = this.state;
const { setSize } = this.state;
const { pixelRatio } = this.props;
setSize(width, height, pixelRatio);
});

View File

@ -62,7 +62,7 @@ export default class RenderChain extends THREE.EffectComposer {
}
}
setSize(width, height, pixelRatio, rerender = true) {
setSize(width, height, pixelRatio, render = true) {
this._renderer.setPixelRatio(pixelRatio);
this._renderer.setSize(width, height);
super.setSize(width * pixelRatio, height * pixelRatio);
@ -70,7 +70,7 @@ export default class RenderChain extends THREE.EffectComposer {
this._camera.aspect = width / height;
this._camera.updateProjectionMatrix();
if (rerender) this.render();
if (render) this.render();
}
render() {

View File

@ -38,7 +38,7 @@ export default class HeightTransformer extends BaseTransformer {
dragStart(event) {
const handle = this.includesHandle(event.intersections);
if (handle) {
this.dispatch(actions.heightStart(handle));
this.dispatch(actions.changeHeightStart(handle));
} else {
super.dragStart(event);
}
@ -47,7 +47,7 @@ export default class HeightTransformer extends BaseTransformer {
drag(event) {
if (this._active) {
const delta = event.position.subtract(event.previousPosition);
this.dispatch(actions.height(delta));
this.dispatch(actions.changeHeight(delta));
} else {
super.drag(event);
}
@ -55,7 +55,7 @@ export default class HeightTransformer extends BaseTransformer {
dragEnd(event) {
if (this._active) {
this.dispatch(actions.heightEnd());
this.dispatch(actions.changeHeightEnd());
} else {
super.dragEnd(event);
}