75 Commits

Author SHA1 Message Date
Zeno Zeng
6d3c41335a docs: update README 2021-06-05 14:44:05 +08:00
Zeno Zeng
91d06bff2e feat: respect transformation matrix in clearRect and drawImage 2021-06-05 13:22:53 +08:00
Zeno Zeng
3703af4632 ctx.prototype.__applyTransformation 2021-06-04 23:49:08 +08:00
Zeno Zeng
d4c59a9c49 feat: rotate & __matrixTransform(x, y) 2021-06-04 22:54:18 +08:00
zenozeng
95ff64fdbd feat: translate 2021-05-04 10:59:54 +00:00
zenozeng
e1b678502a feat: scale 2021-05-03 14:53:46 +00:00
zenozeng
5af6598240 feat: resetTransform 2021-05-03 14:25:09 +00:00
zenozeng
1ab5658372 feat: init transform 2021-05-03 13:18:57 +00:00
Kris Williams
a0125f30a8 Typo - Fixes #58 2017-10-17 09:48:21 -07:00
Tom Kapanka
6d09433261 Merge pull request #48 from mudcube/master
Fixes for a few errors being thrown
2017-06-07 16:59:21 -07:00
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
Johnson Zhong
648fdbd007 Give users the option of wrapping an existing Context2D element 2016-09-02 13:24:41 +02: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
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
9524ff734d Update canvas2svg.js
update version to 1.0.18
2016-04-21 11:49:40 -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
2c1a4323ac v1.0.17 2016-01-22 08:51:37 -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
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
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
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
967b515663 Merge pull request #30 from ConradIrwin/fix-empty-circles
Don't draw invisible circles
2015-09-09 12:09:12 -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
kerryliu
92ea35cc87 port unit tests to mocha and chai, add img diff example tests, add debug playground, setup travis 2015-06-16 19:16:12 -07:00
clintjd
715ce44acd bumped version to 1.0.13 2015-06-16 15:13:33 -07:00
clintjd
9ed0b82b57 Merge pull request #26 from zenozeng/paint-order
set paint order before stroke and fill to make them behavior like canvas
2015-06-16 15:11:33 -07:00
clintjd
a6b9563c9c Update canvas2svg.js 2015-06-16 15:08:34 -07:00
clintjd
5d82d36034 Merge pull request #25 from zenozeng/ctx.arcTo
implementation of ctx.prototype.arcTo
2015-06-16 15:07:21 -07:00
clintjd
ce3e19f7f7 Update canvas2svg.js 2015-06-15 17:26:54 -07:00
clintjd
b55d2b10b5 Merge pull request #24 from zenozeng/master
call lineTo instead moveTo in ctx.arc, fixes closePath issue and straight line issue
2015-06-15 16:55:14 -07:00
Zeno Zeng
36dc5f3cd3 set paint order before stroke and fill to make them behavior like canvas 2015-06-10 15:19:57 +08:00
Zeno Zeng
97f65bc9e7 implementation of ctx.prototype.arcTo 2015-06-08 17:59:28 +08:00
Zeno Zeng
b7223338f9 call lineTo instead moveTo in ctx.arc 2015-06-08 17:37:46 +08:00
clintjd
66f9cef410 bumped version to 1.0.10 2015-06-02 11:11:36 -07:00