Change back to vector when switching costumes

This commit is contained in:
DD 2018-04-09 20:21:04 -04:00
parent 8ffe666478
commit 0529c43c25

View file

@ -19,6 +19,7 @@ import {ensureClockwise} from '../helper/math';
import {clearHoveredItem} from '../reducers/hover'; import {clearHoveredItem} from '../reducers/hover';
import {clearPasteOffset} from '../reducers/clipboard'; import {clearPasteOffset} from '../reducers/clipboard';
import {updateViewBounds} from '../reducers/view-bounds'; import {updateViewBounds} from '../reducers/view-bounds';
import {changeFormat} from '../reducers/format';
import {isVector, isBitmap} from '../lib/format'; import {isVector, isBitmap} from '../lib/format';
@ -114,6 +115,7 @@ class PaperCanvas extends React.Component {
this.props.clearHoveredItem(); this.props.clearHoveredItem();
this.props.clearPasteOffset(); this.props.clearPasteOffset();
if (svg) { if (svg) {
this.props.changeFormat(Formats.VECTOR);
// Store the zoom/pan and restore it after importing a new SVG // Store the zoom/pan and restore it after importing a new SVG
const oldZoom = paper.project.view.zoom; const oldZoom = paper.project.view.zoom;
const oldCenter = paper.project.view.center.clone(); const oldCenter = paper.project.view.center.clone();
@ -290,6 +292,9 @@ const mapDispatchToProps = dispatch => ({
clearPasteOffset: () => { clearPasteOffset: () => {
dispatch(clearPasteOffset()); dispatch(clearPasteOffset());
}, },
changeFormat: format => {
dispatch(changeFormat(format));
},
updateViewBounds: matrix => { updateViewBounds: matrix => {
dispatch(updateViewBounds(matrix)); dispatch(updateViewBounds(matrix));
} }