Commit graph

236 commits

Author SHA1 Message Date
Jürg Lehni
f0fdb804ec Reduce value of EPSILON to the lowest amount that does not cause issues in boolean-test. 2015-01-02 22:37:36 +01:00
Jürg Lehni
cdfd21ddd3 Switch to using new cubic solver by @hkrish 2015-01-02 21:44:29 +01:00
Jürg Lehni
6a11532322 Clean up and simplify code a bit further. 2014-09-28 11:49:46 +02:00
Jürg Lehni
48cb05a181 Replace tabs with 4 white-spaces. 2014-08-16 19:24:54 +02:00
Jürg Lehni
68db4f9b59 Forgotten in previous commit. 2014-05-13 13:23:37 +02:00
Jürg Lehni
19630d6229 Fix spelling mistakes. 2014-04-24 19:34:49 +02:00
Jürg Lehni
f002c633a7 Remove trailing white spaces and ensure newlines at the end. 2014-04-06 13:48:03 +02:00
Jürg Lehni
e22fa3a664 Update copyright notice. 2014-01-04 01:47:16 +01:00
Jürg Lehni
6654dca6bf Improve precision of Numerical.findRoot() 2013-12-30 14:18:33 +01:00
Jürg Lehni
8395541298 Clean up docs and fix spelling mistakes. 2013-12-29 15:44:26 +01:00
Jürg Lehni
10aa8d7b4a Fix accidental documentation leakage into global scope. 2013-12-28 22:34:00 +01:00
Jürg Lehni
a6b3a3a2ec Share code that handles bounds in roots between solveQuadratic() and solveCubic() 2013-12-17 15:38:22 +01:00
Jürg Lehni
76ea7ef066 Inline EPSILON and TOLERANCE for better performance in Numerical. 2013-12-17 15:27:55 +01:00
Jürg Lehni
b5b75dfce4 Clean-up Numerical code. 2013-12-01 23:54:52 +01:00
hkrish
d64df44a78 Correct tolrance check (±EPSILON) in numerical solving methods. 2013-11-24 21:40:22 +01: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
60732e8456 No need for default parameter. 2013-10-10 23:09:18 +02:00
Jürg Lehni
01e48b3322 Improve and clean up fat-line bug fix. 2013-06-13 15:53:28 -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
5592bb57e0 Properly export Numerical and PaperScript again. 2013-05-27 15:55:44 -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
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
Jürg Lehni
dc9a9c42d2 Cleanup solveCubic() further. 2013-04-21 08:44:41 -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
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
bf9acd4499 Correct Numerical.KAPPA value. 2013-04-19 18:57:31 -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
fbe8a558bd Refactor Format literal to Formatter class that keeps precision stored. 2013-04-09 17:32:19 -07:00
Jürg Lehni
2d3f9c36eb Update JSDoc and fix documentation issues. 2013-04-09 17:07:41 -07:00
Jürg Lehni
e63b3a0797 Use short-cut to Math.abs() 2013-03-23 17:05:48 -07:00
Jürg Lehni
9d8cddbe42 Implement new private Format object that handles formatting of number, point, size and rectangle. 2013-02-28 19:14:05 -08:00
Jürg Lehni
e9fef8a53c Fix a couple of newly introduced bugs through CanvasProvider change. 2013-02-12 16:23:30 -08:00
Jürg Lehni
ca3cc7f46d Define CanvasProvider.getContext() next to getCanvas(), and support both types in release(). 2013-02-12 16:06:24 -08:00
Jürg Lehni
51150cb20d Support CanvasProvider.get(width, height) arguments. 2013-02-12 15:57:02 -08:00
Jürg Lehni
357b7dbc54 Shorten CanvasProvider method names. 2013-02-12 15:53:27 -08:00
Jürg Lehni
6c9c16ad3d Update copyright information comments, and year. 2013-01-28 18:03:27 -08:00
Jürg Lehni
4e1db6a1d1 Fix a row of documentation issues. 2012-11-06 13:35:50 -08:00
Jürg Lehni
400b454177 Introduce Numerical.isZero(), for comparisons against 0 with a tolerance. 2012-11-05 21:06:13 -08:00
Jürg Lehni
f73717a7e7 Fix issues in Numerical.solveQuadratic(), solveCubic() and Path#contains().
Closes #71.
2012-10-22 18:21:33 -04:00
Jürg Lehni
59a55f7574 Merge branch 'master' of github.com:paperjs/paper.js 2012-09-30 14:08:44 -07:00
Jürg Lehni
c3f051583c Remove unnecessary return statement.
This code can never be reached.
2012-09-30 14:05:34 -07:00
Jonathan Puckey
d78103339d Make sure value exists. 2012-03-03 21:12:11 +01:00
Jonathan Puckey
b0aa54bf56 Add missing ImageData relating functions to ProxyContext and fix problem where values weren't being returned. 2012-03-02 12:23:32 +01:00
Jonathan Puckey
b75e75f586 Cleanup and fix ProxyContext. 2012-03-01 23:20:15 +01:00
Jonathan Puckey
507ff8bb23 Add ProxyContext helper class to assist in debugging problems relating to interactions with the canvas' 2d context. 2012-03-01 22:25:35 +01:00
Jonathan Puckey
ddec658653 Make Paper.js work on Node.js. 2011-07-30 02:16:30 +02:00
Jürg Lehni
3a7c5286b5 Improve precision of Line#intersect() and other parts that check for a divisor to not be 0, by comparing against the new Numerical.EPSILON rather than Numerical.TOLERANCE. 2011-07-28 11:03:59 +01:00
Jürg Lehni
ba4ff62052 Clean up white space. 2011-07-26 16:00:49 +01:00
Jürg Lehni
8eaeb7fb5e Remove filepp.pl as preprocessor and switch to our own Prepro.js, a simple preprocesssor for JavaScript that speaks JavaScript, written in JavaScript, allowing preprocessing to either happen at build time or compile time. 2011-07-26 10:09:31 +01:00
Jürg Lehni
833d4968ce Change root solvers to not produce new arrays each time but fill a passed one that can be reused. Yields io impressive performance improvements. 2011-07-09 10:50:47 +02:00
Jürg Lehni
5655981f6d Clean up white spaces. 2011-07-07 16:09:02 +02:00
Jürg Lehni
10e7cc994c Fix porting mistakes. 2011-07-06 15:31:36 +02:00
Jürg Lehni
99f6597615 Fix check for quadratic curve by using the right coefficient (a instead of d), and checking with tolerance. 2011-07-05 17:03:49 +02:00
Jürg Lehni
2a9066c555 Fix comment. 2011-07-05 01:17:37 +02:00
Jürg Lehni
f6f4c917f4 Fix accidentally removed comas. 2011-07-05 01:16:20 +02:00
Jürg Lehni
24d77c1ece Remove root fixing code again, seems not necessary. 2011-07-05 01:14:20 +02:00
Jürg Lehni
8a2a9409bd Commit experimental root fixing code. 2011-07-05 01:13:58 +02:00
Jürg Lehni
dad118cc20 Fix comments. 2011-07-04 23:30:25 +02:00
Jürg Lehni
9cf5292496 Define solvers for cubic and quadratic polynomials, as required by hit testing code. 2011-07-04 19:47:54 +02:00
Jürg Lehni
79c0ad8cc5 Update copyright notices. 2011-07-01 12:17:45 +02:00
Richard D. Worth
ac39873693 Whitespace. Removed all trailing whitespace from .js files 2011-06-30 06:01:51 -04:00
Jürg Lehni
7cd749e63d Change all documentation to new convention of defining @class outside injection scope, fix some comments and a few errors with examples. 2011-06-22 23:56:05 +01:00
Jürg Lehni
d5e7ca9f5e Improve explanatory comments. 2011-06-06 11:44:15 +01:00
Jürg Lehni
702269675a Start adding support for rhino-canvas on server. 2011-06-03 14:05:55 +01:00
Jürg Lehni
4a51ff4215 Remove unneeded blend mode. 2011-06-02 14:33:42 +01:00
Jürg Lehni
c07fee0e6b Shorten variable names. 2011-06-02 09:38:13 +01:00
Jürg Lehni
bb11b74fa3 Clean up comments: No need for reference to Context Blender, since code has completely changed. 2011-06-02 09:36:49 +01:00
Jürg Lehni
b02b4bf7a3 Implement HSL blend modes according to PDF specs. 2011-06-02 09:33:41 +01:00
Jürg Lehni
5e7998d803 Rename parameter. 2011-06-01 20:34:35 +01:00
Jürg Lehni
f7bdfc5019 Clean up comments. 2011-06-01 20:32:37 +01:00
Jürg Lehni
d5952ba043 Implement HSB blend modes. 2011-06-01 20:21:25 +01:00
Jürg Lehni
09e9298bf4 Fix blend modes to work correctly with alpha channels. 2011-06-01 19:25:43 +01:00
Jürg Lehni
0d1fcfbb81 Remove unused blend mode 'normal'. 2011-06-01 17:21:14 +01:00
Jürg Lehni
f58aa2a23b Add comment about overlay mode being the reverse of hard-light. 2011-06-01 17:11:06 +01:00
Jürg Lehni
3850e4a53b Optimise code for normal and multiply blend modes by precalculating values. 2011-06-01 17:10:40 +01:00
Jürg Lehni
8bbb3744fe Use min() / max() in darken / lighten for shorter code. 2011-06-01 17:09:32 +01:00
Jürg Lehni
b08abcdd69 Remove 'unsupported' blend mode. 2011-06-01 16:50:14 +01:00
Jürg Lehni
9142c974c3 Revert to longer version of blend mode code as it is faster. 2011-06-01 16:49:48 +01:00
Jürg Lehni
62f5204810 Shorten variable names. 2011-06-01 16:45:42 +01:00
Jürg Lehni
44605433d1 Further shorten and simplify BlendMode cide by having process() only process one pixel value at a time. 2011-06-01 16:34:57 +01:00
Jürg Lehni
9fa193d26f Move opacity precalculation out of variable definition. 2011-06-01 15:31:02 +01:00
Jürg Lehni
117a828b2b Don't set dst[i + 3] directly, set dA2 instead. 2011-06-01 14:01:46 +01:00
Jürg Lehni
acecb1a2c1 Clean up variable names. 2011-06-01 14:01:22 +01:00
Jürg Lehni
b9739aa26a Optimise blend mode loop by pre-calculating divisions. 2011-06-01 14:00:50 +01:00
Jürg Lehni
4a9f0d726f Pre-calculate opacity value. 2011-06-01 14:00:02 +01:00
Jürg Lehni
a1d996df05 Clean up formating. 2011-06-01 13:42:34 +01:00
Jürg Lehni
69e989f834 No need to set dst[i + 3] again after changing dA2, since we are now only setting it after calling process() from the main loop. 2011-06-01 13:42:22 +01:00
Jürg Lehni
c47d281308 Speed up blend-modes by using a lookup table for process functions rather than a switch() statement for each pixel. 2011-06-01 13:37:36 +01:00
Jürg Lehni
29967153c3 Clean up TODO comments... 2011-06-01 10:49:43 +01:00
Jürg Lehni
01fdeb270b Move PaperScript.js to core. 2011-05-14 17:22:49 +01:00
Jürg Lehni
0356fdb3b6 Add PaperScope switching to onFrame handler. 2011-05-14 16:00:30 +01:00
Jürg Lehni
518803f492 Add support for switching PaperScope contexts in PaperScript code exeuction and callback handling. This should add proper support for multiple PaperScript instances in one site. 2011-05-14 14:15:31 +03:00
Jonathan Puckey
bd932a9242 Implement onFrame event.delta & event.time. 2011-05-11 22:46:08 +02:00
Jonathan Puckey
ccf5dd70f6 PaperScript: call the onFrame handler straight away. 2011-05-08 18:44:33 +01:00