Merge pull request #304 from fsih/removePaperUpdate

Remove all view.draw and view.update
This commit is contained in:
DD Liu 2018-03-06 16:24:45 -05:00 committed by GitHub
commit eff43e2eec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 0 additions and 15 deletions

View file

@ -112,7 +112,6 @@ class LineMode extends React.Component {
this.path.add(event.point);
this.path.add(event.point); // Add second point, which is what will move when dragged
paper.view.draw();
}
}
drawHitPoint (hitResult) {

View file

@ -194,7 +194,6 @@ class ModeTools extends React.Component {
}
this.props.incrementPasteOffset();
this.props.setSelectedItems();
paper.project.view.update();
this.props.onUpdateSvg();
}
}

View file

@ -90,7 +90,6 @@ class PaintEditor extends React.Component {
// Restore old zoom
paper.project.view.zoom = oldZoom;
paper.project.view.center = oldCenter;
paper.project.view.update();
}
handleUndo () {
performUndo(this.props.undoState, this.props.onUndo, this.props.setSelectedItems, this.handleUpdateSvg);

View file

@ -62,7 +62,6 @@ class PaperCanvas extends React.Component {
this.importSvg(newProps.svg, newProps.rotationCenterX, newProps.rotationCenterY);
paper.project.view.zoom = oldZoom;
paper.project.view.center = oldCenter;
paper.project.view.update();
} else {
performSnapshot(this.props.undoSnapshot);
}
@ -161,7 +160,6 @@ class PaperCanvas extends React.Component {
}
performSnapshot(paperCanvas.props.undoSnapshot);
paper.project.view.update();
}
});
}

View file

@ -13,11 +13,6 @@ const SelectionHOC = function (WrappedComponent) {
'removeItemById'
]);
}
componentDidMount () {
if (this.props.hoveredItemId) {
paper.view.update();
}
}
componentDidUpdate (prevProps) {
// Hovered item has changed
if ((this.props.hoveredItemId && this.props.hoveredItemId !== prevProps.hoveredItemId) ||

View file

@ -107,7 +107,6 @@ class Blobbiness {
}
blob.cursorPreview.bringToFront();
blob.cursorPreview.position = event.point;
paper.view.draw();
};
this.tool.onMouseDrag = function (event) {
@ -123,7 +122,6 @@ class Blobbiness {
blob.cursorPreview.bringToFront();
blob.cursorPreview.position = event.point;
paper.view.draw();
};
this.tool.onMouseUp = function (event) {

View file

@ -203,7 +203,6 @@ const _deleteItemSelection = function (items, onUpdateSvg) {
for (let i = 0; i < items.length; i++) {
items[i].remove();
}
paper.project.view.update();
onUpdateSvg();
return true;
};
@ -230,7 +229,6 @@ const _removeSelectedSegments = function (items, onUpdateSvg) {
removedSegments = true;
}
if (removedSegments) {
paper.project.view.update();
onUpdateSvg();
}
return removedSegments;

View file

@ -19,7 +19,6 @@ const _restore = function (entry, setSelectedItems, onUpdateSvg) {
}
}
paper.project.importJSON(entry.json);
paper.view.update();
setSelectedItems();
onUpdateSvg(true /* skipSnapshot */);