Commit graph

2987 commits

Author SHA1 Message Date
Jürg Lehni
470cfae9f1 Clean up export code. 2013-06-11 14:15:54 -07:00
Jürg Lehni
a1cab3592b No need to explicitly set fill to 'none' anymore since comparing style with parent handles this for us automatically now. 2013-06-11 14:15:43 -07:00
Jürg Lehni
72082bdcff Fix new failing test. 2013-06-11 13:57:28 -07:00
Jürg Lehni
b4ff0d347e Optimize SVG import for clipped groups. 2013-06-11 12:57:03 -07:00
Jürg Lehni
7faf2a9e70 Clean-up @hkrish's changes a bit. 2013-06-09 18:37:08 -07:00
hkrish
d8498b6418 Remove invalid code and unnecessary comments 2013-06-09 22:02:50 +05:30
hkrish
8758b232f4 Merge branch 'master' into fatline
* master:
  Fix regression in importing SVG viewBox.
  Minor code clean ups.
  Properly fix exporting of classes into Base.exports.
  Switch to HTML5 meta charset tags.
  Fix issues with uglifyjs.
  Include stats.js in distribution so all examples can work.
2013-06-09 18:08:31 +05:30
hkrish
ca2bfb8cab Merge branch 'master' of https://github.com/paperjs/paper.js
* 'master' of https://github.com/paperjs/paper.js:
  Fix regression in importing SVG viewBox.
2013-06-09 18:03:19 +05:30
Jürg Lehni
48651d5fb1 Fix regression in importing SVG viewBox. 2013-06-08 13:44:50 -07:00
hkrish
d6ed9890b8 Merge branch 'master' of https://github.com/paperjs/paper.js
* 'master' of https://github.com/paperjs/paper.js:
  Minor code clean ups.
  Properly fix exporting of classes into Base.exports.
  Switch to HTML5 meta charset tags.
  Fix issues with uglifyjs.
  Include stats.js in distribution so all examples can work.
2013-06-08 23:26:45 +05:30
hkrish
d3405115c1 Use parameter on both curves in CurveLocation objects instead of Point in #getIntersection() 2013-06-08 21:37:43 +05:30
Jürg Lehni
75eddbcdba Minor code clean ups. 2013-06-02 16:18:40 -07:00
Jürg Lehni
b896a98b1e Properly fix exporting of classes into Base.exports. 2013-06-02 16:17:54 -07:00
hkrish
1e86aa4e97 Merge branch 'master' of https://github.com/paperjs/paper.js
* 'master' of https://github.com/paperjs/paper.js:
  Explicitly use bash to avoid build problems on linux.
  Bump version number to 0.9.2
  Fix exporting of Base, Numerical and PaperScript into PaperScope.
2013-05-31 17:21:46 +02:00
Jürg Lehni
a81fdc2758 Fix exporting of Base, Numerical and PaperScript into PaperScope. 2013-05-30 14:37:04 -07:00
hkrish
8d1e5ea144 Merge branch 'master' of https://github.com/paperjs/paper.js
* 'master' of https://github.com/paperjs/paper.js:
  Bump version number to 0.9.1
  Fix issue with local paper variable shielding global one.
  Reset transformation matrix when blitting off-screen canvas.
2013-05-30 23:21:05 +02:00
Jürg Lehni
178b09caa7 Fix issue with local paper variable shielding global one.
We need a cleaner fix for this on the long run.
2013-05-30 11:26:47 -07:00
Jürg Lehni
d76d573eb2 Reset transformation matrix when blitting off-screen canvas.
Closes #233.
2013-05-29 13:52:47 -07:00
hkrish
cdaab794f2 Merge branch 'master' of https://github.com/paperjs/paper.js
* 'master' of https://github.com/paperjs/paper.js: (56 commits)
  Fix regressions in Raster caused by faulty merge.
  Store data in _data rather than on the image itself.
  Clean up @trankek's fix for node a bit.
  Explain compact = true in Project#_serialize()
  Properly fix issue with Project#exportJSON() creating separate projects on import.
  Update straps.js to version 1.1.0
  Rename options.server to options.node
  Remove all create() constructors for basic types since new constructors are now faster.
  Make sure project we import into is active.
  Unbox project data in Project#importJSON(), as we don't want to create a new project object.
  Remove need for _needsRedraw() calls by replacing it with a boolean flag.
  Apply "pending" matrix in group when it receives content.
  Move main Item insertion code from #insertChild() to #insertChildren().
  Fix documentation warning.
  Handle exporting of Numerical and PaperScript in export.js
  Update straps.js to latest version.
  Accessors cannot define the writable property.
  Properly export Numerical and PaperScript again.
  Only reset matrices in Groups when it could actually be applied to the content.
  Set options.stats = false for build.sh and Node.js
  ...
2013-05-29 19:09:07 +02:00
Jürg Lehni
0e2ae48b02 Fix regressions in Raster caused by faulty merge. 2013-05-28 13:54:47 -07:00
Jürg Lehni
73351cbda7 Store data in _data rather than on the image itself. 2013-05-28 08:10:51 -07:00
Jürg Lehni
a952e6f5ad Merge branch 'master' of github.com:paperjs/paper.js 2013-05-28 08:07:26 -07:00
Jürg Lehni
277f7aabae Merge branch 'refs/heads/tranek-master' 2013-05-28 08:06:06 -07:00
Jürg Lehni
c75a98c406 Clean up @trankek's fix for node a bit.
Fix prepro.js conditionals.
2013-05-28 08:05:40 -07:00
Jürg Lehni
e0856a0d31 Merge branch 'master' of https://github.com/tranek/paper.js into tranek-master
Conflicts:
	src/item/Raster.js
2013-05-28 08:00:01 -07:00
Jürg Lehni
f0f7a7f35c Explain compact = true in Project#_serialize() 2013-05-28 07:57:35 -07:00
Jürg Lehni
dd38e4aae6 Merge pull request #231 from NorthNick/master
Path.arcBy bug fix
2013-05-28 07:53:58 -07:00
Jürg Lehni
0b4bc678bc Properly fix issue with Project#exportJSON() creating separate projects on import. 2013-05-28 07:42:38 -07:00
Jürg Lehni
6fa6c022c9 Rename options.server to options.node 2013-05-28 00:01:55 -07:00
Jürg Lehni
cd7db56249 Remove all create() constructors for basic types since new constructors are now faster.
Woop!
2013-05-27 23:57:31 -07:00
Jürg Lehni
0f74c01f75 Make sure project we import into is active. 2013-05-27 23:48:16 -07:00
Jürg Lehni
85920bbdb8 Unbox project data in Project#importJSON(), as we don't want to create a new project object. 2013-05-27 23:43:24 -07:00
Jürg Lehni
4e6f52c20c Remove need for _needsRedraw() calls by replacing it with a boolean flag. 2013-05-27 23:40:23 -07:00
Jürg Lehni
fd3f698fe9 Apply "pending" matrix in group when it receives content. 2013-05-27 23:13:20 -07:00
Jürg Lehni
9b0d32651f Move main Item insertion code from #insertChild() to #insertChildren().
Handles insertion and change notification much more efficiently.
2013-05-27 20:06:30 -07:00
Jürg Lehni
73388d6f9c Fix documentation warning. 2013-05-27 18:30:57 -07:00
Jürg Lehni
961451b271 Handle exporting of Numerical and PaperScript in export.js
Allowing build.sh to work again.
2013-05-27 18:28:35 -07:00
Jürg Lehni
70d6050900 Accessors cannot define the writable property. 2013-05-27 18:12:25 -07:00
Jürg Lehni
5592bb57e0 Properly export Numerical and PaperScript again. 2013-05-27 15:55:44 -07:00
Jürg Lehni
e516e6f651 Only reset matrices in Groups when it could actually be applied to the content.
That way, empty groups in SVGImport still keep their transformation state.
2013-05-27 15:42:16 -07:00
Jürg Lehni
b92be7ecf3 Set options.stats = false for build.sh and Node.js 2013-05-27 15:33:28 -07:00
Jürg Lehni
d577b1bf48 Share one options.js file describing Paper.js options for Node.js, build.sh and the dev version. 2013-05-27 15:11:32 -07:00
Jürg Lehni
6ac5463630 Switch to using common string format for paper.version (major.minor.build) 2013-05-27 14:27:05 -07:00
Jürg Lehni
fef22f25e8 Remove node.js specific version of Base.isPlainObject(), since straps.js can handle it now. 2013-05-27 14:10:38 -07:00
Jürg Lehni
10d5de3ed6 Implement a better way to name and export class constructors.
This change also simplified the way classes are exported to PaperScope objects.
2013-05-27 12:48:58 -07:00
Jürg Lehni
15b1ea7af0 Solve issue with SVG gradients on Firefox. 2013-05-27 10:12:23 -07:00
Jürg Lehni
c533dda7b5 Finally found a better and faster alternative for this.base() calls, by setting base on the function object instead.
base can be accessed on named functions very easily, leading to another measurable speed increase. Finally all performance reasons against straps.js are eliminated!
2013-05-27 10:04:05 -07:00
Jürg Lehni
369b329b23 Change straps.js to directly use initialize() as constructor function rather than redirecting calls to it.
Should yield some interesting performance improvements.
2013-05-27 09:11:50 -07:00
Jürg Lehni
094e35f2e5 No need for separate injection object for Item.extend() 2013-05-27 08:16:34 -07:00
Jürg Lehni
f9267e7f5c Some more code clean up and variable renaming. 2013-05-26 17:59:01 -07:00
Jürg Lehni
14962b5c45 Clean up code a bit more. 2013-05-26 17:52:05 -07:00
Jürg Lehni
32709a176b Fix some comments. 2013-05-26 17:48:36 -07:00
Jürg Lehni
7050edd6e4 Fix point sequence. 2013-05-26 17:40:40 -07:00
Jürg Lehni
90f0679700 Further simplify getConvexHull() by using p0 … p3 point objects. 2013-05-26 17:39:13 -07:00
Jürg Lehni
487c4c4aef Further simplify getConvexHull() by inlining cross product calculations. 2013-05-26 17:32:44 -07:00
Jürg Lehni
9edab9c3aa Simplify convex hull algorithm by returning lists of points rather than lines.
We can avoid some data redundancy that way at no performance cost.
2013-05-26 17:18:54 -07:00
Jürg Lehni
9540b7f6a9 Use addLineIntersection() in subdivision algorithm as well. 2013-05-26 17:10:29 -07:00
Jürg Lehni
20737c6664 Rename various intersection methods. 2013-05-26 17:06:23 -07:00
Jürg Lehni
da8898abd2 Fix newly introduced bug in Line.getSide() through variable renaming. 2013-05-26 17:05:10 -07:00
Jürg Lehni
5d7cc2fb40 Use new Line.getSignedDistance(). 2013-05-26 16:58:49 -07:00
Jürg Lehni
f771233d37 Speed up Line class by removing internal dependance on Point. 2013-05-26 16:58:34 -07:00
Jürg Lehni
80f9f6061c Change the way the Line class handles direction vectors and infinite lines.
The beginning of performance improvements in the Line class.
2013-05-26 15:44:52 -07:00
NickNorth
3e520efe5f arcBy recursively calls itself rather than arcTo. 2013-05-26 20:09:26 +01:00
Jürg Lehni
1fb0a3a13c Always provide t parameter for CurveLocations if we know it. 2013-05-25 11:23:59 -07:00
hkrish
46a324722a Merge branch 'master' of https://github.com/paperjs/paper.js
* 'master' of https://github.com/paperjs/paper.js: (90 commits)
  Start merging fat-line clipping code into Curve class.
  Fix white-spaces.
  Merge handling of flat curves.
  More getConvexHull() clean up.
  Remove unused variable dqmin.
  Further clean up clipFatLine()
  Some clean up in clipFatLine()
  Merge the two convergence checks to one.
  Simplify convergence checks.
  Rename p\d to part\d
  Rename v\dt to range\d
  Simplify handling of ranges and curve parts.
  Switch to using arrays rather than objects for parameter ranges.
  Reverse logic of v1t / _v1t naming and switch to using Numerical constants.
  Re-implement Curve.getLocation2() as "hub" for all the different intersection methods.
  Use break; instead of return; and untangle unnecessarily nested conditionals.
  Define private addLocation() to reduce code redundancy.
  Correctly handle calculation of CurveLocation point in getCurveIntersections().
  Move Curve.getIntersection2 to private function and better name other private functions.
  Always use parameter in getCurveLineIntersection() by flipping curve1 / 2 values as well.
  ...
2013-05-25 11:37:33 +02:00
Jürg Lehni
502c76dbce Start merging fat-line clipping code into Curve class.
And add a prepro option for now.
2013-05-24 22:30:13 -07:00
Jürg Lehni
7f00ef8f05 Fix white-spaces. 2013-05-24 22:25:22 -07:00
Jürg Lehni
7e5f846190 Remove debugging code. 2013-05-24 17:57:13 -07:00
tranek
1637127e09 Fixed data URLs src disappearing 2013-05-24 20:55:59 -04:00
Jürg Lehni
bd3ac02bbe Use Curve instead of this.
Compresses better and allows passing on function as callback.
2013-05-24 17:52:05 -07:00
Jürg Lehni
e359dd038c Add explaining comment. 2013-05-24 17:14:39 -07:00
tranek
cd7938e363 Fixed string equals in Raster data URL for Node.js 2013-05-24 16:41:02 -04:00
tranek
269b93e888 Added data URLs for Rasters in Node.js 2013-05-24 16:38:43 -04:00
hkrish
cfbe6d8312 Merge branch 'master' of https://github.com/paperjs/paper.js
* 'master' of https://github.com/paperjs/paper.js:
  Remove Item#applyMatrix boolean, go back to previous way of directly applying transformations to children in Group and Layer, and introduce new Clip class for non-transformed nested matrices.
  Make sure the Base class is exposed in Node.js
2013-05-16 20:33:13 +02:00
Jürg Lehni
ae416f821c Explain the booolean argument in color getter calls, and put _matrix in local variable for better minification. 2013-05-13 19:31:41 -07:00
Jürg Lehni
7c2e57e105 Remove Item#applyMatrix boolean, go back to previous way of directly applying transformations to children in Group and Layer, and introduce new Clip class for non-transformed nested matrices. 2013-05-13 18:57:17 -07:00
Jürg Lehni
c70b985911 Make sure the Base class is exposed in Node.js 2013-05-12 14:29:21 -07:00
hkrish
158001c154 Merge branch 'master' of https://github.com/paperjs/paper.js
* 'master' of https://github.com/paperjs/paper.js:
  Fix: #initialize() to correctly convert #getValue() array back to Curve object.
  Handle allowNull correctly again in SVGImport.
  Simplify SVGImport attribute parsing and correctly handle failing tests with invalid coordinates.
  Further refine Node.js integration.
  Improve the Node version of Base.isPlainObject()
2013-05-11 14:42:56 +02:00
Harikrishnan Gopalakrishnan
ce600f4ea4 Fix: #initialize() to correctly convert #getValue() array back to Curve object. 2013-05-11 00:59:30 +03:00
Jürg Lehni
2b4dddbb1f Handle allowNull correctly again in SVGImport. 2013-05-09 16:16:48 -07:00
Jürg Lehni
a4e875cf29 Simplify SVGImport attribute parsing and correctly handle failing tests with invalid coordinates. 2013-05-09 16:08:38 -07:00
Jürg Lehni
dd96d67fe1 Further refine Node.js integration. 2013-05-09 16:06:45 -07:00
Jürg Lehni
82b9cb3dbf Improve the Node version of Base.isPlainObject() 2013-05-09 15:30:18 -07:00
hkrish
fce29e4b75 merge upstream 2013-05-09 14:30:28 +02:00
Jürg Lehni
093f4cf7ba Fix issue with SVG transformations not being applied to gradient fills. 2013-05-09 02:37:48 -07:00
Jürg Lehni
04f2f19a43 Minor fix in Matrix#shear() 2013-05-09 02:31:26 -07:00
Jürg Lehni
9e5b47c1ac Implement SVG transform attribute parser, to completely remove dependency on baseVal. 2013-05-09 02:31:10 -07:00
Jürg Lehni
8cc74820a8 Handel issue in node-canvas where color stop offsets cannot be strings. 2013-05-09 01:57:07 -07:00
Jürg Lehni
e2f4eb5a56 Improve Node's Base.isPlainObject() to rule out arrays. 2013-05-09 01:56:47 -07:00
Jürg Lehni
e9fb78aa08 Start removing dependencies on SVG baseVal. 2013-05-09 01:46:13 -07:00
Jürg Lehni
8cd57743c8 Switch to handling SVG tagNames case-insensitively across the whole codebase.
Since Node's jsdom doesn't provide case-sensitive tagNames.
2013-05-09 01:45:38 -07:00
Jürg Lehni
0174f7e2e5 Remove debug logging. 2013-05-09 00:26:41 -07:00
Jürg Lehni
aa757e1d7b Use DOMParser to handle SVG strings. 2013-05-09 00:22:42 -07:00
Jürg Lehni
ee3fa3b00f Implement DOMParser emulation based on jsdom. 2013-05-09 00:22:20 -07:00
Jürg Lehni
ecbde1af14 Rename browser subfolder to dom, since we'll be using it on Node too. 2013-05-09 00:21:58 -07:00
Jürg Lehni
7644016d66 Export paper version in node. 2013-05-08 20:59:54 -07:00
Jürg Lehni
c5627d141e Fix PaperScript support in node. 2013-05-08 20:38:23 -07:00
Jürg Lehni
6f347c98b3 Fix formatting. 2013-05-08 20:29:37 -07:00
Jürg Lehni
731a873884 Check for radial property as well when predicting gradient color type. 2013-05-08 20:19:40 -07:00
Jürg Lehni
67aacb9552 Implement dontLink parameters for View getters. 2013-05-08 20:19:22 -07:00