mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-22 21:42:30 -05:00
Merge pull request #304 from fsih/removePaperUpdate
Remove all view.draw and view.update
This commit is contained in:
commit
eff43e2eec
8 changed files with 0 additions and 15 deletions
|
@ -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) {
|
||||
|
|
|
@ -194,7 +194,6 @@ class ModeTools extends React.Component {
|
|||
}
|
||||
this.props.incrementPasteOffset();
|
||||
this.props.setSelectedItems();
|
||||
paper.project.view.update();
|
||||
this.props.onUpdateSvg();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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) ||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -19,7 +19,6 @@ const _restore = function (entry, setSelectedItems, onUpdateSvg) {
|
|||
}
|
||||
}
|
||||
paper.project.importJSON(entry.json);
|
||||
paper.view.update();
|
||||
|
||||
setSelectedItems();
|
||||
onUpdateSvg(true /* skipSnapshot */);
|
||||
|
|
Loading…
Reference in a new issue