-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yan Heng
committed
Jul 28, 2023
1 parent
a328dd3
commit b67234c
Showing
8 changed files
with
53 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
import { Ellipse } from 'fabric'; | ||
import { BaseFabricObject, Ellipse } from 'fabric'; | ||
|
||
export class PEllipse extends Ellipse { | ||
public id: string; | ||
|
||
constructor(options: Partial<Ellipse> & { id: string }) { | ||
super(options); | ||
this.id = options.id; | ||
} | ||
|
||
public render(ctx: CanvasRenderingContext2D): void { | ||
super.render(ctx); | ||
} | ||
|
||
public toJSON(): BaseFabricObject { | ||
return { ...super.toJSON(), id: this.id }; | ||
} | ||
} | ||
|
||
export default PEllipse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
import { Rect } from 'fabric'; | ||
import { BaseFabricObject, Rect } from 'fabric'; | ||
|
||
export class PRect extends Rect { | ||
public id: string; | ||
|
||
constructor(options: Partial<Rect> & { id: string }) { | ||
super(options); | ||
this.id = options.id; | ||
} | ||
|
||
public render(ctx: CanvasRenderingContext2D): void { | ||
super.render(ctx); | ||
} | ||
|
||
public toJSON(): BaseFabricObject { | ||
return { ...super.toJSON(), id: this.id }; | ||
} | ||
} | ||
|
||
export default PRect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
import { Triangle } from 'fabric'; | ||
import { BaseFabricObject, Triangle } from 'fabric'; | ||
|
||
export class PTriangle extends Triangle { | ||
public id: string; | ||
|
||
constructor(options: Partial<Triangle> & { id: string }) { | ||
super(options); | ||
this.id = options.id; | ||
} | ||
|
||
public render(ctx: CanvasRenderingContext2D): void { | ||
super.render(ctx); | ||
} | ||
|
||
public toJSON(): BaseFabricObject { | ||
return { ...super.toJSON(), id: this.id }; | ||
} | ||
} | ||
|
||
export default PTriangle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters