Skip to content

Commit

Permalink
Remove max bounds for vector images
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed Jan 27, 2024
1 parent bf8ac74 commit 3534127
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/containers/paper-canvas.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {isGroup, ungroupItems} from '../helper/group';
import {clearRaster, convertBackgroundGuideLayer, getRaster, setupLayers, updateTheme} from '../helper/layer';
import {clearSelectedItems} from '../reducers/selected-items';
import {
ART_BOARD_WIDTH, ART_BOARD_HEIGHT, CENTER, MAX_WORKSPACE_BOUNDS,
ART_BOARD_WIDTH, ART_BOARD_HEIGHT, CENTER,
clampViewBounds, resetZoom, setWorkspaceBounds, zoomToFit, resizeCrosshair
} from '../helper/view';
import {ensureClockwise, scaleWithStrokes} from '../helper/math';
Expand Down Expand Up @@ -276,13 +276,10 @@ class PaperCanvas extends React.Component {
}
mask.guide = true;
mask.locked = true;
mask.clipMask = false;
mask.matrix = new paper.Matrix(); // Identity
// Set the artwork to get clipped at the max costume size
mask.size.height = MAX_WORKSPACE_BOUNDS.height;
mask.size.width = MAX_WORKSPACE_BOUNDS.width;
mask.setPosition(CENTER);
paper.project.activeLayer.addChild(mask);
mask.clipMask = true;

// Reduce single item nested in groups
if (item instanceof paper.Group && item.children.length === 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/helper/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const getActionBounds = isBitmap => {
if (isBitmap) {
return ART_BOARD_BOUNDS;
}
return paper.view.bounds.unite(ART_BOARD_BOUNDS).intersect(MAX_WORKSPACE_BOUNDS);
return paper.view.bounds.unite(ART_BOARD_BOUNDS);
};

const zoomToFit = isBitmap => {
Expand Down

0 comments on commit 3534127

Please sign in to comment.