Skip to content

Commit b01fb23

Browse files
committed
chore: bump version to 2.3.0
1 parent 3573673 commit b01fb23

File tree

3 files changed

+114
-87
lines changed

3 files changed

+114
-87
lines changed

CHANGELOG.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
## CHANGELOG
2+
3+
### v2.3.0
4+
5+
- fix: update Regular Expression to handle decimal values
6+
([Validark](https://github.com/Validark))
7+
[#10](https://github.com/zenozeng/svgcanvas/pull/10)
8+
- feat: use browser's built-in font parser
9+
([Validark](https://github.com/Validark))
10+
[#11](https://github.com/zenozeng/svgcanvas/pull/11)
11+
- test: rendering test for svgcanvas
12+
[#14](https://github.com/zenozeng/svgcanvas/pull/14)
13+
14+
### v2.2.2
15+
16+
- Delegate getAttribute/setAttribute ([Validark](https://github.com/Validark))
17+
[#8](https://github.com/zenozeng/svgcanvas/pull/8)
18+
19+
### v2.2.1
20+
21+
- fix(SVGCanvasElement): addEventListener
22+
23+
### v2.2.0
24+
25+
- feat: Context.prototype.getImageData (experimental) for
26+
https://github.com/gliffy/canvas2svg/issues/3 and
27+
https://github.com/zenozeng/p5.js-svg/issues/203
28+
29+
### v2.1.0
30+
31+
- feat: SVGCanvasElement(options)
32+
- feat: options.debug
33+
- refactor
34+
35+
### v2.0.7
36+
37+
- fix typo
38+
- rollup 2.67.0
39+
40+
### v2.0.6
41+
42+
- utils.toString for https://github.com/zenozeng/p5.js-svg/issues/204
43+
44+
### v2.0.5
45+
46+
- Fix adding CanvasPattern ([Xavier Delamotte](https://github.com/x4d3))
47+
[#7](https://github.com/zenozeng/svgcanvas/pull/7)
48+
49+
### v2.0.4
50+
51+
- fix: push/pop transformMatrixStack when save/restore, for
52+
https://github.com/zenozeng/p5.js-svg/issues/191
53+
54+
### v2.0.3
55+
56+
- feat: sync element's width and height to context
57+
58+
### v2.0.2
59+
60+
- feat: Implement CanvasTransform Interface,
61+
https://github.com/gliffy/canvas2svg/pull/83
62+
- feat: ClearCanvas in fillRect
63+
- feat: Element API
64+
- feat: ESM
65+
- fix: Recreate root `<g>` when __clearCanvas to remove all attributes
66+
- chore: Bundle JavaScript using Rollup
67+
- chore: GitHub Actions
68+
69+
### v1.x
70+
71+
- v1.0.19 Fix __parseFont to not crash
72+
- v1.0.18 clip was not working, the path never made it to the clip area
73+
- v1.0.17 Fix bug with drawing in an empty context. Fix image translation
74+
problem. Fix globalAlpha issue.
75+
- v1.0.16 Add npm publishing support, bower file and optimize for arcs with no
76+
angles.
77+
- v1.0.15 Setup travis, add testharness and debug playground, and fix regression
78+
for __createElement refactor
79+
- v1.0.14 bugfix for gradients, move __createElement to scoped createElement
80+
function, so all classes have access.
81+
- v1.0.13 set paint order before stroke and fill to make them behavior like
82+
canvas
83+
- v1.0.12 Implementation of ctx.prototype.arcTo.
84+
- v1.0.11 call lineTo instead moveTo in ctx.arc, fixes closePath issue and
85+
straight line issue
86+
- v1.0.10 when lineTo called, use M instead of L unless subpath exists
87+
- v1.0.9 use currentDefaultPath instead of <path>'s d attribute, fixes stroke's
88+
different behavior in SVG and canvas.
89+
- v1.0.8 reusing __createElement and adding a properties undefined check
90+
- v1.0.7 fixes for multiple transforms and fills and better text support from
91+
stafyniaksacha
92+
- v1.0.6 basic support for text baseline (contribution from KoKuToru)
93+
- v1.0.5 fixes for #5 and #6 (with contributions from KoKuToru)
94+
- v1.0.4 generate ids that start with a letter
95+
- v1.0.3 fixed #4 where largeArcFlag was set incorrectly in some cases
96+
- v1.0.2 Split up rgba values set in fill/stroke to allow illustrator import
97+
support.
98+
- v1.0.1 Allow C2S to be called as a function.
99+
https://github.com/gliffy/canvas2svg/issues/2
100+
- v1.0.0 Initial release

README.md

Lines changed: 13 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
# SVGCanvas
22

3-
Draw on SVG using Canvas's 2D Context API.
4-
A maintained fork of [gliffy's canvas2svg](https://github.com/gliffy/canvas2svg).
3+
Draw on SVG using Canvas's 2D Context API. A maintained fork of
4+
[gliffy's canvas2svg](https://github.com/gliffy/canvas2svg).
55

66
## Demo
77

88
https://zenozeng.github.io/svgcanvas/test/
99

1010
## How it works
1111

12-
We create a mock 2d canvas context. Use the canvas context like you would on a normal canvas. As you call methods, we build up a scene graph in SVG.
12+
We create a mock 2d canvas context. Use the canvas context like you would on a
13+
normal canvas. As you call methods, we build up a scene graph in SVG.
1314

1415
## Usage
1516

1617
```javascript
17-
import { Context } from 'svgcanvas'
18+
import { Context } from "svgcanvas";
1819

1920
const ctx = new Context(500, 500);
2021

@@ -23,25 +24,25 @@ ctx.fillStyle = "red";
2324
ctx.fillRect(100, 100, 100, 100);
2425

2526
// serialize your SVG
26-
const mySerializedSVG = ctx.getSerializedSvg();
27+
const mySerializedSVG = ctx.getSerializedSvg();
2728
```
2829

2930
Wrapping canvas elements:
3031

3132
```javascript
32-
import { Context, Element } from 'svgcanvas';
33+
import { Context, Element } from "svgcanvas";
3334

3435
const canvas = document.createElement("canvas");
3536
const context2D = canvas.getContext("2d");
3637

3738
// more options to pass into constructor:
3839
const options = {
39-
height: 2000, // falsy values get converted to 500
40-
width: 0 / 0, // falsy values get converted to 500
41-
ctx: context2D, // existing Context2D to wrap around
42-
enableMirroring: false, // whether canvas mirroring (get image data) is enabled (defaults to false)
43-
document: undefined, // overrides default document object
44-
}
40+
height: 2000, // falsy values get converted to 500
41+
width: 0 / 0, // falsy values get converted to 500
42+
ctx: context2D, // existing Context2D to wrap around
43+
enableMirroring: false, // whether canvas mirroring (get image data) is enabled (defaults to false)
44+
document: undefined, // overrides default document object
45+
};
4546

4647
// Creates a mock canvas context (mocks `context2D` above)
4748
const ctx = new Context(options);
@@ -64,80 +65,6 @@ dom.svg; // the inline svg element
6465

6566
https://zenozeng.github.io/p5.js-svg/test/
6667

67-
## CHANGELOG
68-
69-
### v2.2.2
70-
71-
- Delegate getAttribute/setAttribute ([Validark](https://github.com/Validark)) [#8](https://github.com/zenozeng/svgcanvas/pull/8)
72-
73-
### v2.2.1
74-
75-
- fix(SVGCanvasElement): addEventListener
76-
77-
### v2.2.0
78-
79-
- feat: Context.prototype.getImageData (experimental) for https://github.com/gliffy/canvas2svg/issues/3 and https://github.com/zenozeng/p5.js-svg/issues/203
80-
81-
### v2.1.0
82-
83-
- feat: SVGCanvasElement(options)
84-
- feat: options.debug
85-
- refactor
86-
87-
### v2.0.7
88-
89-
- fix typo
90-
- rollup 2.67.0
91-
92-
### v2.0.6
93-
94-
- utils.toString for https://github.com/zenozeng/p5.js-svg/issues/204
95-
96-
### v2.0.5
97-
98-
- Fix adding CanvasPattern ([Xavier Delamotte](https://github.com/x4d3)) [#7](https://github.com/zenozeng/svgcanvas/pull/7)
99-
100-
### v2.0.4
101-
102-
- fix: push/pop transformMatrixStack when save/restore, for https://github.com/zenozeng/p5.js-svg/issues/191
103-
104-
### v2.0.3
105-
106-
- feat: sync element's width and height to context
107-
108-
### v2.0.2
109-
110-
- feat: Implement CanvasTransform Interface, https://github.com/gliffy/canvas2svg/pull/83
111-
- feat: ClearCanvas in fillRect
112-
- feat: Element API
113-
- feat: ESM
114-
- fix: Recreate root `<g>` when __clearCanvas to remove all attributes
115-
- chore: Bundle JavaScript using Rollup
116-
- chore: GitHub Actions
117-
118-
### v1.x
119-
120-
- v1.0.19 Fix __parseFont to not crash
121-
- v1.0.18 clip was not working, the path never made it to the clip area
122-
- v1.0.17 Fix bug with drawing in an empty context. Fix image translation problem. Fix globalAlpha issue.
123-
- v1.0.16 Add npm publishing support, bower file and optimize for arcs with no angles.
124-
- v1.0.15 Setup travis, add testharness and debug playground, and fix regression for __createElement refactor
125-
- v1.0.14 bugfix for gradients, move __createElement to scoped createElement function, so all classes have access.
126-
- v1.0.13 set paint order before stroke and fill to make them behavior like canvas
127-
- v1.0.12 Implementation of ctx.prototype.arcTo.
128-
- v1.0.11 call lineTo instead moveTo in ctx.arc, fixes closePath issue and straight line issue
129-
- v1.0.10 when lineTo called, use M instead of L unless subpath exists
130-
- v1.0.9 use currentDefaultPath instead of <path>'s d attribute, fixes stroke's different behavior in SVG and canvas.
131-
- v1.0.8 reusing __createElement and adding a properties undefined check
132-
- v1.0.7 fixes for multiple transforms and fills and better text support from stafyniaksacha
133-
- v1.0.6 basic support for text baseline (contribution from KoKuToru)
134-
- v1.0.5 fixes for #5 and #6 (with contributions from KoKuToru)
135-
- v1.0.4 generate ids that start with a letter
136-
- v1.0.3 fixed #4 where largeArcFlag was set incorrectly in some cases
137-
- v1.0.2 Split up rgba values set in fill/stroke to allow illustrator import support.
138-
- v1.0.1 Allow C2S to be called as a function. https://github.com/gliffy/canvas2svg/issues/2
139-
- v1.0.0 Initial release
140-
14168
## License
14269

14370
This library is licensed under the MIT license.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svgcanvas",
3-
"version": "2.2.2",
3+
"version": "2.3.0",
44
"description": "svgcanvas",
55
"main": "dist/svgcanvas.js",
66
"scripts": {

0 commit comments

Comments
 (0)