Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
Fix bug with production build minifying name of constructors on shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
Peshou committed Nov 21, 2018
1 parent d0527e9 commit 2701d31
Show file tree
Hide file tree
Showing 26 changed files with 963 additions and 782 deletions.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@


## Canvas version changes
#### v3.0.4 Fixes a bug with production build and recognition of shape names by adding an abstract method in the base Shape class.


#### v3.0.0 Removes the `rxjs-compat` library and adds `rxjs^6`. This means that older versions will not be supported if they upgrade to `ng2-canvas-whiteboard^3.0.0`.
#### *This version also changes the way of how this library is built and made ready for publish.*

Expand Down Expand Up @@ -129,7 +132,8 @@ emitted by the **onBatchUpdate** emitter. If received, the user can then manipul
The time in milliseconds that a batch update should be sent after drawing.
##### `imageUrl: string` (optional)
The path to the image. If not specified, the drawings will be placed on the background color of the canvas
The path to the image. If not specified, the drawings will be placed on the background color of the canvas.
This path can either be a base64 string or an actual path to a resource
##### `aspectRatio: number` (optional)
If specified, the canvas will be resized according to this ratio
Expand Down Expand Up @@ -277,6 +281,7 @@ Each shape is made of a starting position point of type ```CanvasWhiteboardPoint
which may be different for each shape, and it's of type ```CanvasWhiteboardShapeOptions```.
Each predefined shape must know how to:
- Return the name of the shape (should be the same as the name of the class)
- Draw itself given a canvas context
- Draw it's preview given a canvas context
- Update itself given a ```CanvasWhiteboardUpdate```
Expand All @@ -297,6 +302,19 @@ class AppComponent {
}
export class RandomShape extends CanvasWhiteboardShape {
linePositions: Array<number>;
constructor(positionPoint?: CanvasWhiteboardPoint, options?: CanvasWhiteboardShapeOptions) {
// Optional constructor if you need some additional setup
super(positionPoint, options);
this.linePositions = [];
}
getShapeName(): string {
// Abstract method which should return a string with the shape name
// Should be the same as the class name
return 'RandomShape';
}
draw(context: CanvasRenderingContext2D): any {
// Tell the canvas how to draw your shape here
Expand Down
20 changes: 19 additions & 1 deletion dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@


## Canvas version changes
#### v3.0.4 Fixes a bug with production build and recognition of shape names by adding an abstract method in the base Shape class.


#### v3.0.0 Removes the `rxjs-compat` library and adds `rxjs^6`. This means that older versions will not be supported if they upgrade to `ng2-canvas-whiteboard^3.0.0`.
#### *This version also changes the way of how this library is built and made ready for publish.*

Expand Down Expand Up @@ -129,7 +132,8 @@ emitted by the **onBatchUpdate** emitter. If received, the user can then manipul
The time in milliseconds that a batch update should be sent after drawing.
##### `imageUrl: string` (optional)
The path to the image. If not specified, the drawings will be placed on the background color of the canvas
The path to the image. If not specified, the drawings will be placed on the background color of the canvas.
This path can either be a base64 string or an actual path to a resource
##### `aspectRatio: number` (optional)
If specified, the canvas will be resized according to this ratio
Expand Down Expand Up @@ -277,6 +281,7 @@ Each shape is made of a starting position point of type ```CanvasWhiteboardPoint
which may be different for each shape, and it's of type ```CanvasWhiteboardShapeOptions```.
Each predefined shape must know how to:
- Return the name of the shape (should be the same as the name of the class)
- Draw itself given a canvas context
- Draw it's preview given a canvas context
- Update itself given a ```CanvasWhiteboardUpdate```
Expand All @@ -297,6 +302,19 @@ class AppComponent {
}
export class RandomShape extends CanvasWhiteboardShape {
linePositions: Array<number>;
constructor(positionPoint?: CanvasWhiteboardPoint, options?: CanvasWhiteboardShapeOptions) {
// Optional constructor if you need some additional setup
super(positionPoint, options);
this.linePositions = [];
}
getShapeName(): string {
// Abstract method which should return a string with the shape name
// Should be the same as the class name
return 'RandomShape';
}
draw(context: CanvasRenderingContext2D): any {
// Tell the canvas how to draw your shape here
Expand Down
46 changes: 41 additions & 5 deletions dist/bundles/ng2-canvas-whiteboard.umd.js

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

4 changes: 2 additions & 2 deletions dist/bundles/ng2-canvas-whiteboard.umd.min.js

Large diffs are not rendered by default.

46 changes: 41 additions & 5 deletions dist/modules/ng2-canvas-whiteboard.es5.js

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

Loading

0 comments on commit 2701d31

Please sign in to comment.