You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 28, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+49-3Lines changed: 49 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,13 @@
2
2
3
3
4
4
## Canvas version changes
5
+
#### v3.1.2, v4.0.1
6
+
Exports all existing canvas shapes, so that they can be easily unregistered from the canvas. (see README for unregistering the shapes).
7
+
8
+
Also, this version introduces two new Inputs, `strokeColorPickerEnabled: boolean` and `fillColorPickerEnabled: boolean`, also deprecates the `colorPickerEnabled` Input.
9
+
10
+
For the sake of reverse-compat, the `colorPickerEnabled` input is still there and it will be used in combination with the two new variables. (ex: `colorPickerEnabled || fillColorPickerEnabled`).
11
+
5
12
#### v3.1.1 Audits the npm packages and upgrades the lodash version from 4.17.11 to 4.17.13
6
13
7
14
#### v3.1.0 Merges the pull request from https://github.com/webfactorymk/ng2-canvas-whiteboard/pull/55 to allow the component to be used in Angular 8 and 9 applications. Also fixes the imports for rxjs items from 'rxjs/index' to 'rxjs'
@@ -191,9 +198,21 @@ Changes to this object will be detected by the canvas in the OnChange listener a
191
198
</canvas-whiteboard>
192
199
```
193
200
201
+
NOTE: In order for the changeDetection to pick up the options changes, you must change the options reference whenever you want to change a value.
202
+
Example:
203
+
```typescript
204
+
public changeOptions(): void {
205
+
this.canvasOptions = {
206
+
...this.canvasOptions,
207
+
fillColorPickerEnabled: true,
208
+
colorPickerEnabled: false
209
+
};
210
+
}
211
+
```
212
+
194
213
### To add text to the buttons via css
195
214
Each button has its on class (example: Draw button -> .canvas_whiteboard_button-draw)<br/>
196
-
This button can be customized by overriding it's css
215
+
This button can be customized by overriding its css
197
216
```css
198
217
.canvas_whiteboard_button-draw:before {
199
218
content: "Draw";
@@ -211,9 +230,17 @@ If using component-only styles, for this to work the viewEncapsulation must be s
This shows/hides the fill color picker. Note: if this field has been to `false`, but the `colorPickerEnabled` field has been to `true`, the color picker will be shown, as per reverse-compat needs.
This shows/hides the stroke color picker. Note: if this field has been to `false`, but the `colorPickerEnabled` field has been set to `true`, the color picker will be shown, as per reverse-compat needs.
217
244
218
245
##### `lineWidth: number` (default: 2)
219
246
This input controls the drawing pencil size
@@ -355,6 +382,25 @@ export class RandomShape extends CanvasWhiteboardShape {
355
382
}
356
383
}
357
384
```
385
+
386
+
## Unregistering Shapes
387
+
388
+
The default shapes can also be unregistered. Example:
NOTE: There must be at least one shape registered for the canvas to work, but for the sake of convenience, all of the default shapes have been exported (maybe someone would want to unregister all of them and register his own shapes), but it is recommended not to unregister the FreeHandShape.
403
+
358
404
# Canvas Whiteboard Shape Selector
359
405
The `CanvasWhiteboardComponent` is now equipped with a shape selector (since the free hand drawing is now a shape because of consistency),
360
406
The shape selector can be managed or hidden with inputs, and it basically calls the `CanvasWhiteboardShapeService` and draws all the
Copy file name to clipboardExpand all lines: dist/README.md
+54-5Lines changed: 54 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,18 @@
2
2
3
3
4
4
## Canvas version changes
5
-
#### v3.0.4 Fixes a bug with production build and recognition of shape names by adding an abstract method in the base Shape class.
5
+
#### v3.1.2, v4.0.1
6
+
Exports all existing canvas shapes, so that they can be easily unregistered from the canvas. (see README for unregistering the shapes).
7
+
8
+
Also, this version introduces two new Inputs, `strokeColorPickerEnabled: boolean` and `fillColorPickerEnabled: boolean`, also deprecates the `colorPickerEnabled` Input.
9
+
10
+
For the sake of reverse-compat, the `colorPickerEnabled` input is still there and it will be used in combination with the two new variables. (ex: `colorPickerEnabled || fillColorPickerEnabled`).
11
+
12
+
#### v3.1.1 Audits the npm packages and upgrades the lodash version from 4.17.11 to 4.17.13
6
13
14
+
#### v3.1.0 Merges the pull request from https://github.com/webfactorymk/ng2-canvas-whiteboard/pull/55 to allow the component to be used in Angular 8 and 9 applications. Also fixes the imports for rxjs items from 'rxjs/index' to 'rxjs'
15
+
16
+
#### v3.0.4 Fixes a bug with production build and recognition of shape names by adding an abstract method in the base Shape class.
7
17
8
18
#### 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`.
9
19
#### *This version also changes the way of how this library is built and made ready for publish.*
@@ -188,9 +198,21 @@ Changes to this object will be detected by the canvas in the OnChange listener a
188
198
</canvas-whiteboard>
189
199
```
190
200
201
+
NOTE: In order for the changeDetection to pick up the options changes, you must change the options reference whenever you want to change a value.
202
+
Example:
203
+
```typescript
204
+
public changeOptions(): void {
205
+
this.canvasOptions = {
206
+
...this.canvasOptions,
207
+
fillColorPickerEnabled: true,
208
+
colorPickerEnabled: false
209
+
};
210
+
}
211
+
```
212
+
191
213
### To add text to the buttons via css
192
214
Each button has its on class (example: Draw button -> .canvas_whiteboard_button-draw)<br/>
193
-
This button can be customized by overriding it's css
215
+
This button can be customized by overriding its css
194
216
```css
195
217
.canvas_whiteboard_button-draw:before {
196
218
content: "Draw";
@@ -208,9 +230,17 @@ If using component-only styles, for this to work the viewEncapsulation must be s
This shows/hides the fill color picker. Note: if this field has been to `false`, but the `colorPickerEnabled` field has been to `true`, the color picker will be shown, as per reverse-compat needs.
This shows/hides the stroke color picker. Note: if this field has been to `false`, but the `colorPickerEnabled` field has been set to `true`, the color picker will be shown, as per reverse-compat needs.
214
244
215
245
##### `lineWidth: number` (default: 2)
216
246
This input controls the drawing pencil size
@@ -352,6 +382,25 @@ export class RandomShape extends CanvasWhiteboardShape {
352
382
}
353
383
}
354
384
```
385
+
386
+
## Unregistering Shapes
387
+
388
+
The default shapes can also be unregistered. Example:
NOTE: There must be at least one shape registered for the canvas to work, but for the sake of convenience, all of the default shapes have been exported (maybe someone would want to unregister all of them and register his own shapes), but it is recommended not to unregister the FreeHandShape.
403
+
355
404
# Canvas Whiteboard Shape Selector
356
405
The `CanvasWhiteboardComponent` is now equipped with a shape selector (since the free hand drawing is now a shape because of consistency),
357
406
The shape selector can be managed or hidden with inputs, and it basically calls the `CanvasWhiteboardShapeService` and draws all the
@@ -470,4 +519,4 @@ If this is the case you may want to call a resize event for the window for the s
0 commit comments