Commit graph

2773 commits

Author SHA1 Message Date
Jürg Lehni
c70b9e7d7d Fix issue with Path#strokeBounds with #strokeJoin == 'miter' and clockwise orientation.
Closes #206.
2013-04-24 19:27:31 -07:00
Jürg Lehni
420fb49230 Speed up Raster#getPixel(). 2013-04-24 18:09:58 -07:00
Jürg Lehni
ead3646581 Handle alpha channels correctly in Raster#get/setPixel.
Closes #209.
2013-04-24 16:29:28 -07:00
Jürg Lehni
69512ac396 Simplify and document Segment#_serialize(). 2013-04-23 07:39:31 -07:00
Jürg Lehni
6029f59494 More uppercase changes. 2013-04-23 07:29:30 -07:00
Jürg Lehni
96d9b6730f Rename Svg acronyms in API to SVG. 2013-04-23 07:19:08 -07:00
Jürg Lehni
cebeb11301 Rename Json acronyms in API to JSON. 2013-04-23 07:13:51 -07:00
Jürg Lehni
faecb7e78a Allow creation of items when project has no layers. 2013-04-22 23:25:34 -07:00
Jürg Lehni
1b61e4333c Implement Project#clear(). 2013-04-22 22:48:36 -07:00
Jürg Lehni
885d75296d Fix Layer#isInserted() for nested Layers. 2013-04-22 22:47:48 -07:00
Jürg Lehni
0c114883e1 Add unique ids to CurveLocation. 2013-04-22 19:11:42 -07:00
Jürg Lehni
6800a6d534 Use separate id ranges for different classes. 2013-04-22 19:09:59 -07:00
Jürg Lehni
2a53dbe60f Restructure Color constructor to remove need for Color.create(). 2013-04-22 19:07:38 -07:00
Jürg Lehni
dc9a9c42d2 Cleanup solveCubic() further. 2013-04-21 08:44:41 -07:00
Jürg Lehni
2fc4ff10ee Implement Item#_contains() with local coordinates, and have Item#contains() take Item#matrix into account. 2013-04-21 08:43:05 -07:00
Jonathan Puckey
b8085c330f Rename properties to object in Rectangle constructor docs. 2013-04-21 16:07:54 +02:00
Jonathan Puckey
3136480e5e Clean up Segment object constructor example. 2013-04-21 16:02:26 +02:00
Jonathan Puckey
3517493f76 Improve PointText constructor examples. 2013-04-21 15:59:51 +02:00
Jonathan Puckey
52e7c39567 Improve Curve documentation. 2013-04-21 15:43:57 +02:00
Jonathan Puckey
e4203c2e36 Improve Color documentation. 2013-04-21 15:36:20 +02:00
Jonathan Puckey
d4d1a0fdae Improve Style example code. 2013-04-21 15:36:03 +02:00
Jonathan Puckey
191213f362 Improve GradientStop example code. 2013-04-21 15:35:45 +02:00
Jonathan Puckey
fbc3985bbf Add Gradient class examples. 2013-04-21 15:35:31 +02:00
Jonathan Puckey
fdd367e1c2 Add titles to Path.Constructors documentation examples. 2013-04-21 13:58:22 +02:00
Jonathan Puckey
a5997dcc24 Add example to Item#contains(point) docs. 2013-04-21 13:56:29 +02:00
Jonathan Puckey
daf8d0f881 Rename 'properties' constructor parameter to 'object' in docs. 2013-04-21 13:54:31 +02:00
Jonathan Puckey
0369f5aea9 Fix mistake in example code. 2013-04-21 13:53:13 +02:00
Jürg Lehni
4b24690207 Implement Shape#contains() and define unit tests for it. 2013-04-20 20:54:06 -07:00
Jürg Lehni
2793709935 Fix wrong Shape.Circle size. 2013-04-20 20:53:40 -07:00
Jürg Lehni
db7eb65bd7 Implement Item#contains() and use it for hit-testing Rasters. 2013-04-20 20:41:52 -07:00
Jürg Lehni
bb03c72ce8 Implement Item#hasFill(). 2013-04-20 20:40:20 -07:00
Jürg Lehni
acd3236989 Optimize Shape constructors by passing along point. 2013-04-20 20:24:16 -07:00
Jürg Lehni
e8695dee9b Replace solveCubic() code with version that does not use cbrt() calls. 2013-04-20 20:04:23 -07:00
Jürg Lehni
6fc2d50939 Remove cbrt() since we don't use it anymore. 2013-04-20 20:00:11 -07:00
Jürg Lehni
c45ad26b67 Remove tolerance parameter from solveCubic() / solveQuadratic() since we should always use EPSILON. 2013-04-20 19:58:42 -07:00
Jürg Lehni
14aa8e5dea Improve precision of Numerical.solveCubic() and fix issues in Curve.getCrossings().
Closes #202.
2013-04-20 19:14:19 -07:00
Jürg Lehni
461def5383 Fix issue with imprecise tangents / normals to curves at t = 0, 1. 2013-04-20 17:40:19 -07:00
Jürg Lehni
1952e3dc7d Implement Curve#getCurvatureAt(). 2013-04-20 17:26:51 -07:00
Jürg Lehni
bcb10a222f Add SvgImport example for Inkscape and fix issue with multiple SVG path commands.
Closes #203.
2013-04-20 14:54:21 -07:00
Jürg Lehni
3025c63179 Simplify Style creation. 2013-04-19 20:00:30 -07:00
Jürg Lehni
41a58acb8c Document new approach to styles. 2013-04-19 19:51:04 -07:00
Jürg Lehni
f51dc65cca Use Color object for default. 2013-04-19 19:39:05 -07:00
Jürg Lehni
53dac53ca0 Restructure code organization by separating canvas related utility classes into separate canvas folder, and move inclusion of utilities classes to beginning.
Was needed because Numerical.KAPPA is accessed at compile time.
2013-04-19 19:38:48 -07:00
Jürg Lehni
e1807214f4 Large refactoring of Style handling for notable speed improvements. 2013-04-19 19:31:29 -07:00
Jürg Lehni
98f7c020bd Use Item#type instead of instanceof checks for better performance. 2013-04-19 19:27:02 -07:00
Jürg Lehni
bf9acd4499 Correct Numerical.KAPPA value. 2013-04-19 18:57:31 -07:00
Jürg Lehni
9da392a99c Commit initial support for Shape class.
Hit testing is still missing.
2013-04-19 17:25:50 -07:00
Jürg Lehni
90f2614d52 Export Numerical object and move KAPPA constant there. 2013-04-19 17:03:41 -07:00
Jürg Lehni
9cc0822477 Move PlacedItem#_hitTest() to PlacedSymbol#_hitTest() since it was written for symbols, and remove PlacedItem as it's an empty class now. 2013-04-19 16:40:30 -07:00
Jürg Lehni
67203e753c Move #applyMatrix setting to PathItem. 2013-04-19 13:16:00 -07:00
Jürg Lehni
8d99aa5f95 Handle color transformation in Item#transform() rather than Path#_applyMatrix().
Fixes an issue with BoucingBalls.html, now that CompoundPath#applyMatrix is true.
2013-04-19 13:13:54 -07:00
Jürg Lehni
bb546decae Various improvements to Color caching mechanisms. 2013-04-19 12:51:53 -07:00
Jürg Lehni
9efbc288a1 Merge Path.Rectangle and Path.RoundRectangle. 2013-04-19 12:36:49 -07:00
Jürg Lehni
922b9b5bd0 Rename _cloning parameter to _preserve. 2013-04-19 11:54:16 -07:00
Jürg Lehni
2e265693ff Make #drawSelected() protected. 2013-04-18 17:50:53 -07:00
Jürg Lehni
517b2ee27f Inline Item.drawSelectedBounds() code. 2013-04-18 17:07:32 -07:00
Jürg Lehni
9ee8590a4d Move Item.draw() to Item#draw().
Makes more sense this way.
2013-04-18 17:04:06 -07:00
Jürg Lehni
d23e21edd7 Make Item#draw() protected, so we know to not directly call it. 2013-04-18 16:58:35 -07:00
Jürg Lehni
d1c6b7134f Fix Raster#getAverageColor() to work with new transforms history code. 2013-04-18 16:50:18 -07:00
Jürg Lehni
c50b940ff3 Fix Item#rasterize() to work with new matrices history code. 2013-04-18 16:23:27 -07:00
Jürg Lehni
1333f59d54 Have CompoundPath always apply transformations by default. 2013-04-18 16:22:21 -07:00
Jürg Lehni
d2b43b043a Fix comment. 2013-04-16 19:41:45 -07:00
Jürg Lehni
96b886ae8d Avoid endless recursion when changing view from onFrame handler.
Closes #184.
2013-04-09 22:38:23 -07:00
Jürg Lehni
9fe1ff951a Clean up code. 2013-04-09 20:36:38 -07:00
Jürg Lehni
7f245974e6 Implement a faster method to filter out beginnings of intersected curves. 2013-04-09 20:35:31 -07:00
Jürg Lehni
a9a0857ba4 Find a better strategy to avoid duplicate solutions in PathItem#getIntersections().
Closes #197.
2013-04-09 20:27:55 -07:00
Jürg Lehni
2c3e8a32ab Handle nested matrices correctly when drawing blend modes or transparency.
Closes #194.
2013-04-09 20:01:10 -07:00
Jürg Lehni
f79e561512 Handle bounds correctly for groups with only empty children. 2013-04-09 19:24:41 -07:00
Jürg Lehni
0f19e72733 Minor tweaks. 2013-04-09 19:12:47 -07:00
Jürg Lehni
b55d89acda Move handling of clipping outside of draw function, so canvas context can correctly be saved and restored for clipping paths too. 2013-04-09 19:08:41 -07:00
Jürg Lehni
90cc10cc4b Calculate _globalMatrix for all drawn items and use it for the drawing of selections. 2013-04-09 18:52:47 -07:00
Jürg Lehni
e9aad895ae Import and export Item#data in SVG as well.
Closes #188.
2013-04-09 17:53:26 -07:00
Jürg Lehni
e2a118e43e Make sure color components cannot be anything else than numbers. 2013-04-09 17:43:18 -07:00
Jürg Lehni
fbe8a558bd Refactor Format literal to Formatter class that keeps precision stored. 2013-04-09 17:32:19 -07:00
Jürg Lehni
8da8f116d1 Restructure style related class organization. 2013-04-09 17:08:09 -07:00
Jürg Lehni
2d3f9c36eb Update JSDoc and fix documentation issues. 2013-04-09 17:07:41 -07:00
Jürg Lehni
b3b0fa649b Minor Style refactoring clean-ups. 2013-04-09 16:51:57 -07:00
Jürg Lehni
b4a99415d0 Merge PathStyle, CharacterStyle and ParagraphStyle into Style.
Closes #130.
2013-04-09 16:46:20 -07:00
Jürg Lehni
a4f36a59a6 Minor code simplification. 2013-04-09 14:04:25 -07:00
Jürg Lehni
8feb510ea1 Make sure highlight remains an optional component. 2013-04-09 09:34:39 -07:00
Jürg Lehni
9d0b9dc4c6 Allow implicit Gradient declaration in Color object literals. 2013-04-09 09:27:46 -07:00
Jürg Lehni
0d125e1a12 Make sure Gradient#stops and #radial are alway set. 2013-04-09 09:23:08 -07:00
Jürg Lehni
26efbdb451 Implement argument reading for Gradient objects. 2013-04-09 09:20:32 -07:00
Jürg Lehni
b9532f6a1a Rename Color#hilite -> Color#highlight. 2013-04-09 08:51:14 -07:00
Jürg Lehni
10c0a44940 Make sure _components are always defined before parsers are called. 2013-04-09 08:40:09 -07:00
Jürg Lehni
da7b32a18e Clean up code references to GradientColor. 2013-04-09 08:36:17 -07:00
Jürg Lehni
bf21e32082 Implement calling of _removeOwner() for gradients. 2013-04-09 08:36:02 -07:00
Jürg Lehni
9b50020721 Check for gradient Colors correctly. 2013-04-09 08:35:42 -07:00
Jürg Lehni
5550ecaf25 Bring back missing Color constructor documentation. 2013-04-09 08:29:39 -07:00
Jürg Lehni
fd0f4f0929 Remove GradientColor and move all documentation to Color. 2013-04-09 08:23:20 -07:00
Jürg Lehni
a99c91e729 Implement Color component parsers. 2013-04-09 08:17:57 -07:00
Jürg Lehni
d3bb68d0e0 Use faster Array construction. 2013-04-09 07:55:09 -07:00
Jürg Lehni
b3256684fb Make Color#toString() work for gradients. 2013-04-09 01:26:51 -07:00
Jürg Lehni
5209e97c8d Merge GradientColor into Color.
Work in progress.
2013-04-09 01:21:36 -07:00
Jürg Lehni
380fce3946 Simplify GradientColor code before merge with Color. 2013-04-08 23:29:15 -07:00
Jürg Lehni
9cdc4b9372 Switch back to only one Gradient constructor for both linear and radial Gradients. 2013-04-08 20:52:21 -07:00
Jürg Lehni
ca1a395dbd Invert Color#gray component. 2013-04-08 20:20:47 -07:00
Jürg Lehni
727db4c5f2 Further improve Color constructors. 2013-04-08 20:06:29 -07:00
Jürg Lehni
3ffb2e6a75 Refactor Color conversion code. 2013-04-08 19:42:17 -07:00
Jürg Lehni
062abab78b More work on Color refactoring.
Improve backward compatible constructors.
2013-04-08 13:50:12 -07:00