mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-22 13:32:28 -05:00
Change back to vector when switching costumes
This commit is contained in:
parent
8ffe666478
commit
0529c43c25
1 changed files with 5 additions and 0 deletions
|
@ -19,6 +19,7 @@ import {ensureClockwise} from '../helper/math';
|
|||
import {clearHoveredItem} from '../reducers/hover';
|
||||
import {clearPasteOffset} from '../reducers/clipboard';
|
||||
import {updateViewBounds} from '../reducers/view-bounds';
|
||||
import {changeFormat} from '../reducers/format';
|
||||
|
||||
import {isVector, isBitmap} from '../lib/format';
|
||||
|
||||
|
@ -114,6 +115,7 @@ class PaperCanvas extends React.Component {
|
|||
this.props.clearHoveredItem();
|
||||
this.props.clearPasteOffset();
|
||||
if (svg) {
|
||||
this.props.changeFormat(Formats.VECTOR);
|
||||
// Store the zoom/pan and restore it after importing a new SVG
|
||||
const oldZoom = paper.project.view.zoom;
|
||||
const oldCenter = paper.project.view.center.clone();
|
||||
|
@ -290,6 +292,9 @@ const mapDispatchToProps = dispatch => ({
|
|||
clearPasteOffset: () => {
|
||||
dispatch(clearPasteOffset());
|
||||
},
|
||||
changeFormat: format => {
|
||||
dispatch(changeFormat(format));
|
||||
},
|
||||
updateViewBounds: matrix => {
|
||||
dispatch(updateViewBounds(matrix));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue