Commit graph

4382 commits

Author SHA1 Message Date
Jürg Lehni
4f27be8f12 Include new, improved point in path algorithm based on winding number.
It's also possible to switch to using the canvas's native isPointInPath() through options.nativeContains
2013-10-18 14:22:59 +02:00
Jürg Lehni
eae526f38c Update Numerical.solveQuadratic() / solveCubic() to optionally filter results to be in a given range. 2013-10-18 13:52:01 +02:00
Jürg Lehni
523b9ea592 Fix syntax error. 2013-10-18 11:50:36 +02:00
Jürg Lehni
89704243b1 Simplify Numerical.solveQuadratic() 2013-10-18 11:48:23 +02:00
Jürg Lehni
a07538b205 Use same tolerance in Curve.isLinear() as in Curve#isLinear(). 2013-10-17 20:19:34 +02:00
Jürg Lehni
2a3ede67bb Define more tests for Path#contains(). 2013-10-17 20:18:56 +02:00
Jürg Lehni
085fa3e1c6 Set named arguments at the end, since some depend on geometry to be defined (e.g. #clockwise). 2013-10-17 14:03:05 +02:00
Jürg Lehni
8852cad04f Fix SVGExport tests to work with new Shape code. 2013-10-17 13:12:51 +02:00
Jürg Lehni
73d2c34088 Implement item-level #equals() method and clean up other equals methods. 2013-10-17 13:08:54 +02:00
Jürg Lehni
83be3cb023 Fix SVGImport tests to work with new Shape import. 2013-10-17 13:02:35 +02:00
Jürg Lehni
9976033655 Implement serialization of selection. 2013-10-17 12:04:11 +02:00
Jürg Lehni
3958d35f28 Change behavior of Path#fullySelected.
Setting it on empty paths does the same as Path#selected.
2013-10-17 12:03:46 +02:00
Jürg Lehni
c2a34d9f1f Implement an easier approach in serialization to handle the default value of leading. 2013-10-17 11:53:34 +02:00
Jürg Lehni
1eb6b49e8a Allow serialization values to mark themselves as _default.
Solves unnecessarily serialized leading values.
2013-10-17 11:47:46 +02:00
Jürg Lehni
efe8bab129 Revert previous Style change. 2013-10-17 11:40:44 +02:00
Jürg Lehni
7a3448712b Remove duplicate test and clean up code. 2013-10-17 11:32:11 +02:00
Jürg Lehni
2324fbc565 Define correct style default for leading. 2013-10-17 11:14:34 +02:00
Jürg Lehni
922f224cbd Finally remove the _gradientMatrix hack. 2013-10-16 23:47:21 +02:00
Jürg Lehni
9956a6ff51 Implement Shape#toPath(), analogue to Path#toShape().
This way is much simpler though.
2013-10-16 23:44:50 +02:00
Jürg Lehni
51cf1cfec6 Clean up Path#toShape(). 2013-10-16 23:35:50 +02:00
Jürg Lehni
772f8175e4 Remove path to shape guess-work from SVGExport. 2013-10-16 23:21:29 +02:00
Jürg Lehni
c4c7a37993 Implement Path#toShape(), Segment#isColinear(), Segment#isOrthogonal() and Segment#isArc(). 2013-10-16 23:10:03 +02:00
Jürg Lehni
0129080a08 SVG: Add parallelogram to example.
We should really have a test-case in place...
2013-10-16 17:11:15 +02:00
Jürg Lehni
751dfe52ea SVG: Define additional orthogonal check when determining shape type.
Closes #283.
2013-10-16 17:06:29 +02:00
Jürg Lehni
be5a73a61d SVG: Implement support for Shape. 2013-10-16 16:47:00 +02:00
Jürg Lehni
8ab6c61b0d Rename Shape#type to Shape#shape, to avoid clash with Item#type. 2013-10-16 16:46:22 +02:00
Jürg Lehni
3c0d1f26db Replace accidental semi-colon. 2013-10-16 16:14:37 +02:00
Jürg Lehni
953bba4c7b SVG: Use Shape instead of Path constructors for primitive shapes. 2013-10-16 16:12:46 +02:00
Jürg Lehni
392cef3961 Add missing colon. 2013-10-16 16:11:08 +02:00
Jürg Lehni
b581c84d8b Move CompoundPath#reduce() to Item#reduce(). 2013-10-16 16:10:28 +02:00
Jürg Lehni
c0c5695b5a Fix indentation. 2013-10-16 16:09:34 +02:00
Jürg Lehni
fb6ff59218 Improve ProxyContext: Use JSON.stringify() for rendering values correctly, and streamline code. 2013-10-16 16:09:11 +02:00
Jürg Lehni
d45ba19914 SVG: Use new Path.Ellipse constructor. 2013-10-16 15:28:59 +02:00
Jürg Lehni
01a0920c92 SVG: Fix faulty parsing of matrix values. 2013-10-16 15:27:49 +02:00
Jürg Lehni
f63cb40723 Fix SVG error in importing transformed gradients with highlights. 2013-10-16 15:09:23 +02:00
Jürg Lehni
1decf451b4 Implement efficient filtering of already consumed values in argument reading from object literals. 2013-10-16 15:08:44 +02:00
Jürg Lehni
9eb1c104da Implement Shape#clone() 2013-10-16 15:04:50 +02:00
Jürg Lehni
b35296ef3e Improve Shape.Ellipse to support center & radius parameters, and update documentation. 2013-10-16 15:04:37 +02:00
Jürg Lehni
b325aebc77 Docs: More smaller fixes. 2013-10-16 15:03:29 +02:00
Jürg Lehni
543609c0c6 Have Path.Ellipse constructor support negative radius values correctly. 2013-10-16 14:25:14 +02:00
Jürg Lehni
c945bf7908 Docs: Various smaller clean ups. 2013-10-16 14:20:13 +02:00
Jürg Lehni
3af179e2cf Docs: Improve Path constructors. 2013-10-16 14:19:25 +02:00
Jürg Lehni
41d6650666 Add support for named center & radius arguments to Path.Ellipse. 2013-10-16 13:32:40 +02:00
Jürg Lehni
4b636dd31c Clean up Path constructors code. 2013-10-16 13:26:08 +02:00
Jürg Lehni
8fdcbce5ac Improve argument reading in Segment. 2013-10-16 13:15:08 +02:00
Jürg Lehni
ac5c45906f Update to latest straps.js, with changed Base.create() method. 2013-10-14 23:37:43 +02:00
Jürg Lehni
ba8e0b791e Fix rotated primitives example.
Only use Path shapes here.
2013-10-14 21:27:08 +02:00
Jürg Lehni
041d88c89c Clean up clipping example. 2013-10-14 21:26:43 +02:00
Jürg Lehni
2263afea59 Start implementing rounded rectangles in Shape.Rectangle. 2013-10-14 19:57:28 +02:00
Jürg Lehni
d8f7799fc4 Update rotates primitives examples. 2013-10-14 19:56:51 +02:00