Skip to content

Commit

Permalink
feat(primitives): SVG parser/renderer (#893)
Browse files Browse the repository at this point in the history
* Dependency: add markup.ml

* initial implementation

* example

* split into separate modules

* add basic SVGString component

* split out RenderContext

* pass dimensions to canvas render function

* largeArc -> size

* fix viewport transform

* add CanvasContext.drawRoundedRect

* viewBox

* implement arc path commands

* add polygon

* add named color lookup by string

* parse color names

* improve error reporting

* add more examples

* implement quad path command

* make color lookup case insensitive

* fix fill and stroke defaults

* fix stroke width default

* handle auto for rect's rx, ry

* fix v path command

* add fixed examples compensating for missing features

* implement polyline

* add source to examples where appropriate

* add a few real world examples

* convert path parser to state machine to fix several edge cases

* enable anti-aliasing on paint

* skia: add Path.getLastPoint

* implement V and H path commands

* implement S path command

* implement s path command (hopefully)

* format,

* refactor path command parser to support implicit chaining

* fix flash example source

* remove redundant tweaked close path example

* add second quad bezier example

* implement T following Q (but not q, T, t)

* remove empty Style module

Co-authored-by: Et7f3 <cadeaudeelie@gmail.com>

* refactor SVGExample to remove smelly code

* simplify pattern match

Co-authored-by: Et7f3 <cadeaudeelie@gmail.com>

* format,

Co-authored-by: Github Runner <runner@runner.github.com>
Co-authored-by: Et7f3 <cadeaudeelie@gmail.com>
  • Loading branch information
3 people authored Jun 12, 2020
1 parent 8fd2003 commit 5912a7b
Show file tree
Hide file tree
Showing 36 changed files with 2,322 additions and 48 deletions.
30 changes: 29 additions & 1 deletion bench.esy.lock/index.json

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

53 changes: 53 additions & 0 deletions bench.esy.lock/opam/markup.0.8.2/opam

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

31 changes: 29 additions & 2 deletions doc.esy.lock/index.json

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

53 changes: 53 additions & 0 deletions doc.esy.lock/opam/markup.0.8.2/opam

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

30 changes: 29 additions & 1 deletion esy.lock/index.json

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

53 changes: 53 additions & 0 deletions esy.lock/opam/markup.0.8.2/opam

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

30 changes: 29 additions & 1 deletion examples.esy.lock/index.json

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

Loading

0 comments on commit 5912a7b

Please sign in to comment.