Skip to content

Commit

Permalink
bump(fabric): to 6.0.0-rc2 (#36)
Browse files Browse the repository at this point in the history
* fix breaking change `getDefaults` in constructor
  • Loading branch information
ShaMan123 authored Jun 17, 2024
1 parent 612d4b5 commit 71acbd1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 23 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@erase2d/fabric": "file:../fabric",
"bootstrap": "^5.2.3",
"bootstrap-icons": "^1.11.3",
"fabric": "^6.0.0-beta19",
"fabric": "^6.0.0-rc2",
"next": "^13.4.10",
"react": "^18.2.0",
"react-bootstrap": "^2.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/app/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'bootstrap-icons/font/bootstrap-icons.css';
import 'bootstrap/dist/css/bootstrap.min.css';
import { FabricObject } from 'fabric/dist/fabric';
import type { FabricObject } from 'fabric';
import { type AppProps } from 'next/app';
import Head from 'next/head';
import Link from 'next/link';
Expand Down
4 changes: 2 additions & 2 deletions packages/fabric/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@erase2d/fabric",
"version": "1.1.1",
"version": "1.1.2",
"description": "Fabric.js erase2d bindings",
"type": "module",
"scripts": {
Expand All @@ -27,7 +27,7 @@
"fabric"
],
"peerDependencies": {
"fabric": "^6.0.0-beta19"
"fabric": "^6.0.0-rc2"
},
"peerDependenciesMeta": {
"fabric": {
Expand Down
20 changes: 7 additions & 13 deletions packages/fabric/src/ClippingGroup.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
import {
FabricObject,
FixedLayout,
Group,
GroupProps,
LayoutManager,
FixedLayout,
Path,
FabricObject,
GroupProps,
classRegistry,
} from 'fabric';

export class ClippingGroup extends Group {
static type = 'clipping';

static getDefaults(): Record<string, any> {
return {
...super.getDefaults(),
originX: 'center',
originY: 'center',
left: 0,
top: 0,
};
}

private blockErasing = false;

constructor(objects: FabricObject[], options: Partial<GroupProps>) {
super(objects, {
originX: 'center',
originY: 'center',
left: 0,
top: 0,
layoutManager: new LayoutManager(new FixedLayout()),
...options,
});
Expand Down

0 comments on commit 71acbd1

Please sign in to comment.