Commit graph

3286 commits

Author SHA1 Message Date
Jürg Lehni
b91c8f93f8 Remove Curve. _getEdgeSum() again, and inline code in Path.isClockwise() 2013-10-18 19:51:54 +02:00
Jürg Lehni
1fc9f882ca Fix a minor bug in CompoundPath#contains(), improve comments and clean up code. 2013-10-18 19:49:05 +02:00
Jürg Lehni
304ecbc3be Define compoundChildren hitTest option to get matching children instead of parent. 2013-10-18 15:40:41 +02:00
Jürg Lehni
f8106ae18f Improve code handling special winding cases. 2013-10-18 15:20:32 +02:00
Jürg Lehni
75a209c002 Handle more special cases in winding algorithm. 2013-10-18 15:15:54 +02:00
Jürg Lehni
5d0fd8f970 Implement Style#windingRule and use it in Path#contains(). 2013-10-18 14:54:13 +02:00
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
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
73d2c34088 Implement item-level #equals() method and clean up other equals methods. 2013-10-17 13:08:54 +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
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
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
2263afea59 Start implementing rounded rectangles in Shape.Rectangle. 2013-10-14 19:57:28 +02:00
Jürg Lehni
7285ec636a Improve CanvasView constructor.
Support canvas / size arguments, but not both together, and throw exception if both fail.
2013-10-14 16:06:30 +02:00
Jürg Lehni
a3d0e0d462 Clean up throw statements.
Never throw plain strings.
2013-10-14 16:05:50 +02:00
Jürg Lehni
b9ba2364fe Move Shape#isEmpty() to right place. 2013-10-14 09:15:34 +02:00
Jürg Lehni
198305b75c Remove doc comment since Item#isEmpty() is already documented, and move it to an inline comment. 2013-10-14 09:14:59 +02:00
Oliver Jones
df7f1fe874 Override default isEmpty method for Shape
Fixes (new Group([new Shape.Rectangle(...)])).bounds throwing ReferenceError when using Item's isEmpty
2013-10-12 19:28:45 +01:00
hkrish
e20ff3b0a1 Calculate correct parameter for linear segments 2013-10-11 22:03:07 +02:00
hkrish
f0434548c6 Fix regression issues with Curve-Line intersection code 2013-10-11 20:48:34 +02:00
Jürg Lehni
dfa1687a90 Adapt to new bower_components directory. 2013-10-11 00:20:30 +02:00
Jürg Lehni
60732e8456 No need for default parameter. 2013-10-10 23:09:18 +02:00
Jürg Lehni
c68a7d33da Switch from options.browser and options.node to options.environment 2013-10-10 23:09:00 +02:00
Jürg Lehni
6b45a9382c Replace typeof x !== 'undefined' checks with typeof x === 'object'. 2013-10-10 20:36:33 +02:00
Jürg Lehni
94fac965ec Minor improvement in Base.equals() 2013-10-10 20:15:56 +02:00
Jürg Lehni
c5e43778bc Allow the minification of the undefined variable by defining it as a local parameter inside the paper scope. 2013-10-10 20:15:32 +02:00
Jürg Lehni
d158056899 Optimise DomElement.getPrefixValue() 2013-10-10 16:40:46 +02:00
Jürg Lehni
22e13df102 Implement support for Hi-DPI canvas on Retina screens. 2013-10-10 16:31:24 +02:00
Jürg Lehni
03efd56df7 Fix strange issue on iOS 7 where a simple regular expression appears to cause a complete browser crash.
Closes #306.
2013-10-10 14:47:27 +02:00
Jürg Lehni
24e46bee60 Merge branch 'refs/heads/boolean-fix' 2013-10-08 20:50:47 +02:00
Jürg Lehni
0860cdd941 Clean up code a bit. 2013-10-08 20:49:24 +02:00
Jürg Lehni
367aa8ea28 Do not allow numeric values for Item#name.
Closes #298.
2013-10-08 20:38:16 +02:00
Jürg Lehni
921a68e4a2 Rename _removeFromNamed to _removeNamed. 2013-10-08 20:25:26 +02:00
Jürg Lehni
9103c19e6f Fix issues with #dashOffset when emulating native dashes.
Closes #303.
2013-10-08 10:50:59 +02:00
Jürg Lehni
9c98ef8316 Have paper.install() override existing definitions.
And include a warning about this approach in the documentation.
2013-09-23 11:49:23 -07:00
Jürg Lehni
1ee6bb7e79 Use isZero() when checking for straight curves in Curve.getLength() 2013-09-23 08:13:32 -07:00
Jürg Lehni
509ac48951 Fix indentation levels. 2013-09-22 18:18:22 -07:00
Jürg Lehni
cae4520665 Simplify addCurveLineIntersections() code. 2013-09-22 18:18:03 -07:00
Jürg Lehni
5f8c00fe8d Start implementing Item#globalToLocal() and #localToGlobal() 2013-09-22 18:04:27 -07:00
hkrish
8434b4bebe Fix: Syntax error! 2013-09-22 17:49:10 +02:00
hkrish
f9b4321a56 Boolean -fix: Interpolate to find the parameter of intersection in linear curve segments 2013-09-21 17:26:14 +02:00
hkrish
0a22211393 Conform to paperjs coding style. 2013-09-21 15:26:14 +02:00
hkrish
4f54ac1f4c Boolean -fix: Correctly perform boolean operations regardless of the input paths' winding direction 2013-09-17 19:50:13 +02:00
hkrish
669fb1638a Boolean -fix: Preserve the order of intersections found (Curve-Line) according to the PathItem they belong to. 2013-09-13 02:44:51 +02:00
Jürg Lehni
5a45260740 Docs: Fix shadow example. 2013-09-12 15:30:07 -07:00
hkrish
abe0e5e059 Boolean -fix: CurveLocation now keeps track of the correct segment at intersections 2013-09-13 00:08:43 +02:00
Jürg Lehni
cc29cab671 Fix issue with importing SVG document nodes.
Closes #276.
2013-08-26 16:35:15 -07:00
Jürg Lehni
19c7788617 Fix documentation irregularities. 2013-08-23 19:45:28 -07:00
Jürg Lehni
cd74aaf5a3 Remove caching of inverse transform.
View#matrix can be directly modified, and we don't have change tracking on matrices yet.
2013-08-23 19:29:28 -07:00
Jürg Lehni
19f50be897 No need to pass false for allowNull as it's the default. 2013-08-16 19:20:35 -07:00
Jürg Lehni
40f2547e5f Correctly detect image size on all browsers.
Closes #268.
2013-08-15 11:32:47 -07:00
Jürg Lehni
cb6833176c Use named module AMD syntax for defining paper.
Closes #261.
2013-08-14 14:26:23 -07:00
Jürg Lehni
590c89840c Merge Raster#setImage() and #setCanvas(). 2013-08-14 12:29:56 -07:00
Jürg Lehni
cc565b3fe2 Rename Raster#getSubImage() to #getSubCanvas(), and use insert: false combined with #insertAbove() to correctly insert newly created rasters. 2013-08-14 12:21:47 -07:00
Jürg Lehni
5981ddf89f Implement Raster#getSubRaster() and document both #getSubImage() and #getSubRaster(). 2013-08-14 12:14:28 -07:00
Jürg Lehni
1a1c2674fd Take Item#matrix into account when drawing gradients.
Closes #267.
2013-08-14 11:27:04 -07:00
Jürg Lehni
720dd1b35d Do not apply operator overloading in situations where UpdateExpressions happen inside other contexts that would cause a change of behavior, e.g. array[i++], or if (i++ < 1).
Closes #260.
2013-08-09 10:58:29 -07:00
Jürg Lehni
1120b6012c Merge pull request #262 from huochunpeng/fix_typo_in_matrix
fix typo "Concatentates".
2013-08-08 17:24:40 -07:00
Jürg Lehni
46f6261d38 Merge pull request #265 from duckmaestro/master
Fix to #263: _children undefined inside call to myShape.isEmpty().
2013-08-08 17:24:10 -07:00
Jürg Lehni
6b19f25f4b Fix typos in comments. 2013-08-08 15:21:35 -07:00
Clifford Champion
2d3200c8d7 Fix to #263: _children undefined inside call to myShape.isEmpty(). 2013-07-27 23:47:49 -07:00
Chunpeng Huo
4904a1df1f fix typo "Concatentates". 2013-07-26 15:22:37 +10:00
Jürg Lehni
5e8ec2066b Clean up comment. 2013-07-21 16:52:18 -07:00
Jürg Lehni
16735e23af Simplify code for #insertAbove/Below(), by introducing a private helper.
Making overriding in Layer simpler.
2013-07-21 16:41:45 -07:00
Jürg Lehni
5e210c583a Switch to returning items instead of booleans in #insertAbove/Below() and adjust documentation accordingly. 2013-07-21 16:29:13 -07:00