Commit graph

6977 commits

Author SHA1 Message Date
sapics
a9cc938967 Fix normalization in solveQuadratic 2016-06-20 13:53:39 +09:00
sapics
bb683c9291 Remove same value solution in solveCubic 2016-06-20 13:52:54 +09:00
Jürg Lehni
ab24f92373 Bring back accidentally removed hit-test optimization in event handling.
See comment.
2016-06-19 11:02:54 +02:00
Jürg Lehni
739788b67e Clean up Event#currentTarget handlig. 2016-06-19 10:55:04 +02:00
Jürg Lehni
cc55991b66 Fix new issue with Emitter unit tests. 2016-06-18 23:14:48 +02:00
Jürg Lehni
f133475405 Implement MouseEvent#currentTarget and document MouseEvent#target.
Relates to #995
2016-06-18 23:06:17 +02:00
Jürg Lehni
f97143d37d Fix jshint issue introduced by a03631f620 2016-06-17 00:50:06 +02:00
Jürg Lehni
a03631f620 Remove MouseEvent#target hitTest() getter magic again.
Relates to #995
2016-06-17 00:42:40 +02:00
Jürg Lehni
74b22266f7 Clean up code from #1082 & #1083 2016-06-16 14:16:48 +02:00
Jürg Lehni
fa0a474ec7 Merge pull request #1083 from iconexperience/solve-cubic
Add check of value range in Curve.solveCubic to improve performance
2016-06-16 14:02:48 +02:00
Jürg Lehni
388146be06 Merge pull request #1082 from iconexperience/add-bounds
Add rough bounds checking for _addBounds()
2016-06-16 14:00:22 +02:00
Jan
7009fc3ea0 Add check of value range in solveCubic
Performance of `Curve.solveCubic()` can be improved by first checking if the specified value is within the curve's value range. If it is outside the range, the expensive call to `Numerical.solveCubic()` is not necessary.
2016-06-16 13:13:16 +02:00
Jan
c217e963b8 Rough bounds checking for _addBounds()
Performance of `_addBounds()` can be improved significantly by performing a rough bounds checking first. This is a cheap way to check if the curve can extend the current min or max values at all. Only if the check is passed, further Only if the current bounds can be extended by the curve's bounds, further calculation needs to be done.
Also, if the values of a curve are sorted, the extrema are simply the start and end point.
2016-06-16 12:46:12 +02:00
Jürg Lehni
827abd21b8 More refactoring for a328f5b04b 2016-06-16 12:07:38 +02:00
Jürg Lehni
e80b2ff043 Some code-cleanup for a328f5b04b 2016-06-16 11:48:29 +02:00
Jürg Lehni
85c680820e No more need for #_getCurves() since it now does the same as #getCurves()
#getCurves() works both on Path and CompoundPath. Relates to #1073, #1075
2016-06-16 11:16:56 +02:00
Jürg Lehni
1a392bb5db Rename monoCurves -> curves where full curves are dealt with now.
For better clarity. Relates to #1073, #1075
2016-06-16 11:15:27 +02:00
iconexperience
a328f5b04b Revamp winding calculation so it can determine the winding in horizontal and vertical direction. Monotonic curves are new only created on demand. 2016-06-16 10:13:10 +02:00
Jürg Lehni
eb752a43cd Merge pull request #1081 from sapics/minor-fix
Fix to cover the case when Numerical.solveQuadratic return -1
2016-06-16 09:53:54 +02:00
sapics
ff6484ba8c Fix to cover the case when Numerical.solveQuadratic return -1 in Numerical.solveCubic 2016-06-16 14:53:32 +09:00
sapics
c5b4828ace Fix to cover the case when Numerical.solveQuadratic return -1 in path._getMonoCurves culculation 2016-06-16 13:51:44 +09:00
Jürg Lehni
2a668dd04e Merge pull request #1079 from iconexperience/patch-1
Make Numerical.solveQuadratic() optimizable for Chrome V8
2016-06-15 15:17:33 +02:00
Jan
262b9b388d Make Numerical.solveQuadratic() optimizable for Chrome V8
Little change to help Chrome's V( optimize `Numerical.solveQuadratic()`. In my use case this resulted in an overall performance improvement of about 1.5%. For details see #1078
2016-06-15 14:53:28 +02:00
Jürg Lehni
383e574368 Sync online examples back to repo, and some minor cleanups. 2016-06-14 17:22:54 +02:00
Jürg Lehni
643df2d46d Add Raster#loaded to reflect the loading state of its image. 2016-06-14 17:08:32 +02:00
Jürg Lehni
c378050783 Fix linting error. 2016-06-14 17:02:05 +02:00
Jürg Lehni
2a3945c4a5 Add additional explanation to fix for #995 2016-06-14 16:54:16 +02:00
Jürg Lehni
724bcb2e35 Make sure mouse events propagate to the view while their targets remain consistent.
Closes #995
2016-06-14 16:52:31 +02:00
Jürg Lehni
93e4d81645 Clean up previous fix for #1069 by better handling mouseenter / leave events. 2016-06-14 16:15:50 +02:00
Jürg Lehni
6b3d8ecdfd Add missing semi-colon. 2016-06-14 15:26:08 +02:00
Jürg Lehni
f6b77b7442 Do not change cashed decomposed matrix data when transforming content.
Just clear the cache and force new decomposition on next use, to avoid issues with nested applied transforms.

Closes #1004
2016-06-14 15:16:45 +02:00
Jürg Lehni
2551027d17 Merge pull request #1077 from sapics/fix-leak
Fix variable leak
2016-06-14 12:42:55 +02:00
sapics
a0b868c1ba Fix indentations 2016-06-14 12:26:28 +09:00
sapics
7b91e41131 Fix variable leak 2016-06-14 12:20:58 +09:00
Jürg Lehni
0cb9c50e8f Implement unit test for #1054
Closes #1054
2016-06-13 14:54:13 +02:00
Jürg Lehni
ea5a635edf Implement unit tests for #964
Closes #964.
2016-06-13 14:51:38 +02:00
Jürg Lehni
28543deaf5 Boolean: Handle situations where seg.getNext() can be null.
Closes #1056
2016-06-13 14:17:47 +02:00
Jürg Lehni
742401a0e1 Fix Item#insertChildren() error when passing null for some children.
Relates to #1036
2016-06-13 14:16:25 +02:00
Jürg Lehni
693898a5b1 No more need for two passes of findBestIntersection()
Goodbye strict-mode :)
2016-06-13 12:49:57 +02:00
Jürg Lehni
fbe787dc4d Fix leaked global. 2016-06-13 12:13:42 +02:00
Jürg Lehni
8da82fed19 Mark all segments as visited when processing intersection and subtraction, not just overlaps. 2016-06-13 12:09:17 +02:00
Jürg Lehni
af5a5b5f2d Make findBestIntersection() more strict and improve comments. 2016-06-13 12:08:44 +02:00
Jürg Lehni
94853669f6 Do not complain about open paths if they would not contain an area when closed. 2016-06-13 12:08:04 +02:00
Jürg Lehni
7241edd98a Implement a more refined strategy to handle 'contour' segment in unite boolean operations.
Improvement for the fix in 648beb33e9 for #1054, solves the issues described in https://github.com/paperjs/paper.js/issues/1054#issuecomment-225356983
2016-06-13 11:58:18 +02:00
Jürg Lehni
34c35e26bd Switch to sampling only one location for winding contribution.
Closes #1073
2016-06-13 11:26:02 +02:00
Jürg Lehni
4c94553b81 Minor cleanup. 2016-06-13 09:00:29 +02:00
Jürg Lehni
fc600595a4 Implement improved strategy to handle tangents in CurveLocation#isCrossing()
Relates to #1074
2016-06-13 08:56:45 +02:00
Jürg Lehni
4966f6250f Implement better calculation of tangential angles in CurveLocation#isCrossing()
Relates to #1074
2016-06-12 18:53:14 +02:00
Jürg Lehni
5854c25dd5 Implement Curve#getOffsetAtTime() 2016-06-12 18:32:05 +02:00
Jürg Lehni
b0d0e41ddc Allow negative offsets in all Curve#get*At() methods.
To search from the end of the curve instead of the beginning.
2016-06-12 18:21:37 +02:00