105 Commits

Author SHA1 Message Date
Michael Deal
e90927c2fd Change to regular if() statement 2017-05-18 22:44:03 -07:00
Michael Deal
49f22cc7a3 fix issue with parsing fonts familys that have numbers in their names 2017-01-16 15:06:27 -08:00
Michael Deal
f9d5e2b68e fix issue with applying gradient to stroke 2017-01-06 16:56:12 -08:00
Michael Deal
214f8f2a1a revert regexp 2016-08-13 21:30:06 -07:00
Michael Deal
c7df7fa81e fix issue with mixing transform with path commands
Fixes this case:
var ctx = new C2S()
ctx.save()
ctx.translate(10, 10)
ctx.fillStyle = 'red'
ctx.fillRect(0, 0, 10, 10)
ctx.fillStyle = 'blue'
ctx.fillRect(10, 0, 10, 10)
ctx.fillStyle = 'green'
ctx.fillRect(20, 0, 10, 10)

ctx.fillStyle = 'pink'
ctx.translate(10, 10);
ctx.rect(0, 0, 10, 10);
ctx.translate(10, 10);
ctx.rect(0, 0, 100, 100);
ctx.scale(2, 2)
ctx.rect(100, 100, 10, 10);
ctx.fill()
window.open(`data:image/svg+xml;utf8,${ctx.getSerializedSvg()}`)
2016-08-13 16:59:17 -07:00
Michael Deal
17a2239c37 make if/for/function formatting uniform 2016-08-13 15:47:36 -07:00
Michael Deal
0b16b0c346 fix issue in ctx.closePath()
prevents path from starting with ‘Z’ and throwing an error
2016-07-28 01:07:38 -07:00
clintjd
6983b3d782 Update package.json 2016-04-21 12:00:55 -07:00
clintjd
140c10ad6e Update bower.json 2016-04-21 12:00:42 -07:00
clintjd
ca7d22f67c Update README.md 2016-04-21 12:00:27 -07:00
clintjd
acd32ed95f Update canvas2svg.js
update to 1.0.19
2016-04-21 11:59:59 -07:00
clintjd
db62162a47 Merge pull request #42 from Janpot/fix-font
Fix __parseFont to not crash
2016-04-21 11:59:26 -07:00
clintjd
6c76129768 Update package.json
update version to 1.0.18
2016-04-21 11:51:29 -07:00
clintjd
04e17605ac Update bower.json 2016-04-21 11:51:02 -07:00
clintjd
6795d6be70 Update README.md
update version to 1.0.18
2016-04-21 11:50:41 -07:00
clintjd
9524ff734d Update canvas2svg.js
update version to 1.0.18
2016-04-21 11:49:40 -07:00
clintjd
92464d63b6 Merge pull request #41 from Janpot/fix-clip
.clip was not working, the path never made it to the clip area
2016-04-21 11:48:22 -07:00
Jan Potoms
6a3e940119 Fix __parseFont to not crash 2016-04-16 22:23:38 +02:00
Jan Potoms
769f20b0e1 .clip was not working, the path never made it to the clip area 2016-04-16 22:06:25 +02:00
Gabriel Hernandez
c909ae09d7 1.0.17 2016-01-22 09:14:16 -08:00
Gabriel Hernandez
2c1a4323ac v1.0.17 2016-01-22 08:51:37 -08:00
Gabriel Hernandez
aab4b1808c Merge pull request #39 from FuZhenn/master
fixed a bug with globalAlpha
2016-01-20 11:17:38 -08:00
fuzhen
d70b13eedd add tests for globalAlpha 2016-01-16 17:22:47 +08:00
fuzhen
f302a60389 fixed duplicate def of globalAlpha in STYLES 2016-01-06 23:58:17 +08:00
fuzhen
efcdc56ccd fixed a bug with globalAlpha 2016-01-06 23:27:49 +08:00
Gabriel Hernandez
093bedd087 Merge pull request #38 from FuZhenn/master
Fix drawImage and add new __clearCanvas
2016-01-05 12:41:24 -08:00
fuzhen
9dc92b79aa 1. move back to image.getAttribute("src")
2. save the original transform of C2S context in drawImage
2015-12-18 09:59:13 +08:00
fuzhen
ef3ab241e6 reset stacks when clearing canvas 2015-12-17 12:52:13 +08:00
fuzhen
170b8c574d 1. clear entire canvas when clearRect(0,0, canvas.width, canvas.height), this removes unnecessary white rects generated by clearRect when clearing canvas.
2. clone child SVG node at first before drawImage(c2s, x, y) to prevent unwanted updates by parent C2S context.
2015-12-17 02:12:48 +08:00
fuzhen
d2e840c077 fix a bug that image is not translated to (dx, dy) when ctx.drawImage(img, dx, dy) 2015-12-17 01:20:29 +08:00
fuzhen
14e37d734c replace image.getAttribute("src") with image.src. 2015-12-16 13:19:05 +08:00
Gabriel Hernandez
b624e26d18 Merge pull request #35 from FuZhenn/master
empty context and setDashLine
2015-12-14 08:38:38 -08:00
fuzhen
c29f752612 add example of setLineDash 2015-11-27 12:58:41 +08:00
Fu Zhen
9ee9cc2e6c implements setLineDash
implements canvas.setLineDash
2015-11-27 03:34:03 +08:00
Fu Zhen
1e101b54a9 setLineDash
an additional not implemented method: setLineDash.
2015-11-26 22:44:33 +08:00
Fu Zhen
73735519b1 Merge pull request #1 from FuZhenn/Fuzhenn-fix-draw-empty-ctx
when drawImage a empty C2S context
2015-11-26 22:32:06 +08:00
Fu Zhen
8a8d081561 when drawImage a empty C2S context
Null pointer error will be thrown when ctx.drawImage(ctx) with an empty C2S context with no childNodes.

These code may fix the problem.
2015-11-26 22:31:35 +08:00
Gabriel Hernandez
ec6e29af6c v1.0.16 2015-09-09 12:15:32 -07:00
Gabriel Hernandez
967b515663 Merge pull request #30 from ConradIrwin/fix-empty-circles
Don't draw invisible circles
2015-09-09 12:09:12 -07:00
Gabriel Hernandez
92bed4b9d6 Merge pull request #31 from ConradIrwin/commonjs
Make canvas2svg work with commonjs and jsdom
2015-09-09 12:05:36 -07:00
Conrad Irwin
363cc72ebf Add gulp bump 2015-09-09 11:05:11 -07:00
Conrad Irwin
4aa7a90586 +bower.json 2015-09-09 10:59:13 -07:00
Conrad Irwin
273fd09ca7 document using with node.js 2015-09-09 00:37:10 -07:00
Conrad Irwin
c1cb3c284e Add a test for using a custom document 2015-09-09 00:29:04 -07:00
Conrad Irwin
2a8c062588 Add a test for empty arcs 2015-09-09 00:19:54 -07:00
Conrad Irwin
39e081b711 Make canvas2svg work with jsdom 2015-09-05 15:50:20 -07:00
Conrad Irwin
d3b5e999c8 export as a common js module
Useful for people wanting to use browserify/webpack
2015-09-05 14:11:49 -07:00
Conrad Irwin
8d5249760a Don't draw invisible circles 2015-09-05 00:03:43 -07:00
clintjd
bb2aac32e0 Update canvas2svg.js 2015-06-18 17:11:13 -07:00
clintjd
e356e21d80 updated image url to build and added 1.0.15 info 2015-06-18 17:07:08 -07:00