Commit graph

1193 commits

Author SHA1 Message Date
hkrish
20b6d699db Consistently return curve parameter on Line intersections as well, so that sorting intersections wouldn't fail. 2013-12-23 23:34:26 +01:00
hkrish
20fbdcffda Subdivide only if tDiff on both curves have failed to converge more than 80% 2013-12-23 23:27:23 +01:00
Jürg Lehni
45ed406aa3 Remove unnecessary exports. 2013-12-16 21:58:32 +01:00
Jürg Lehni
94b27e933a Some more variable renaming. 2013-12-16 21:56:41 +01:00
Jürg Lehni
e9d2c6cfd4 Further simplify code a bit. 2013-12-16 21:45:06 +01:00
Jürg Lehni
d984a2cd87 Use correct value for tolerance in non-fatline code again. 2013-12-16 21:41:46 +01:00
Jürg Lehni
a59a42376a Clean up coding style a bit. 2013-12-16 21:40:40 +01:00
hkrish
5fe092672e Fatline clipping: fix c-hull corner case. 2013-12-14 00:31:42 +01:00
hkrish
a0013da7f8 Merge branch 'master' into fatline
* master: (71 commits)
  Define the default value for Color#alpha.
  Some minor changes in Satie example.
  Include point property in stroke hit-results.
  Clean up code and comments in various places.
  Use Point.read() for center parameter in Item#rotate
  Make hit-tests work again with projects that don't have a view.
  Write documentation for Item#anchor.
  Keep support for Item#registration for now as well, since there are some scripts on the mailing list that use it.
  Rename Item#registration to Item#anchor
  No need to run Radial Rainbows in HiDPI mode.
  Include Satie Sound Analysis Example.
  Only start dragging if none of the mosedown events have stopped propagation.
  Fix item-level mousedrag events again.
  Allow layers to select children again, since it breaks examples otherwise.
  Fix documentation issues in TextItem.
  Make hit-test tolerance dependent of view#matrix
  Implement options.selected for hit-testing segments and handles.
  Fix typo in new segment / handle hit-testing code.
  Use same stroke tolerance approach for hit-testing joins and caps as well.
  Do not factor in view matrix into Item#globalMatrix.
  ...
2013-12-13 20:04:43 +01:00
hkrish
5fb75593c2 Remove enpoint fix from curve-line intersections, since it's already handled 2013-12-13 20:01:58 +01:00
Jürg Lehni
d176acfc53 Include point property in stroke hit-results. 2013-12-11 17:10:32 +01:00
hkrish
ef66b6dbe6 Fatline clipping: fix convergence check to be more strict 2013-12-10 20:45:25 +01:00
Jürg Lehni
68bce5b062 Implement options.selected for hit-testing segments and handles. 2013-12-10 19:34:25 +01:00
Jürg Lehni
52891830e4 Fix typo in new segment / handle hit-testing code. 2013-12-10 18:59:04 +01:00
Jürg Lehni
9177bac125 Use same stroke tolerance approach for hit-testing joins and caps as well. 2013-12-10 14:23:05 +01:00
Jürg Lehni
7c28c7e9e3 Do not factor in view matrix into Item#globalMatrix.
Instead concatenate it when drawing selections.
2013-12-10 13:18:21 +01:00
Jürg Lehni
48c8946f9e Implement correct hit-testing tolerance using transformed 2D stroke padding rather than unscaled numerical tolerance.
But we still need to factor in the View zoom as well...
2013-12-10 12:52:42 +01:00
Jürg Lehni
d65ede7df8 Correctly take strokePadding and transformation matrices into account in roughBounds, through new Path._getPenPadding() 2013-12-10 11:43:05 +01:00
hkrish
ac41f0d3c1 Fatline clipping: fix issue where one of the curves has been converged completely and other hasn't. 2013-12-09 23:27:26 +01:00
hkrish
0598afd77b Fatline clipping: remove old #curveIntersection method 2013-12-09 19:36:14 +01:00
Jürg Lehni
b7943239eb Implement cached getInternalRoughBounds as well. 2013-12-09 19:33:34 +01:00
hkrish
2fa5e3d417 Remove debug helpers 2013-12-09 19:31:58 +01:00
hkrish
82ab532885 Fatline clipping: clipConvexHull method handles only the clipping part 2013-12-09 19:31:04 +01:00
hkrish
35acebb91d Fatline clipping: remove old fatline code. This is handled by the CurveIntersections method now 2013-12-09 19:30:03 +01:00
hkrish
6041b2b09d Fatline clipping: new #CurveIntersections method 2013-12-09 19:28:56 +01:00
Jürg Lehni
1e9fc61644 Fix issues with deserializing selection states. 2013-12-09 15:18:43 +01:00
Jürg Lehni
44e913201d Switch back to instanceof checks.
As people are started to subclass Paper.js classes...
2013-12-09 15:04:44 +01:00
Jürg Lehni
e238d23194 Implement caching of internal, untransformed bounds. 2013-12-09 10:53:19 +01:00
hkrish
b471b90229 Fatline clipping: Iterate to find intersections 2013-12-08 23:29:38 +01:00
hkrish
68b9adac95 Modify old clipFatline code to a much cleaner version 2013-12-08 23:15:18 +01:00
hkrish
45e35aad83 New CurveCurveINtersections code; doing the fatline clip inplace. 2013-12-08 23:14:13 +01:00
Jürg Lehni
17e4078e3b Fix a newly introduced bug in drawSegments() 2013-12-08 22:16:27 +01:00
Jürg Lehni
064d632d65 More matrix related clean-ups. 2013-12-08 22:12:36 +01:00
Jürg Lehni
8cec512cc2 Take matrices into account in PathItem#getIntersections() 2013-12-08 22:00:40 +01:00
Jürg Lehni
516b9d040f Apply matrices before calculating boolean path operations. 2013-12-08 21:39:56 +01:00
hkrish
6c5e18ae45 New clip convex-hull routine 2013-12-08 19:09:59 +01:00
Jürg Lehni
fc4e88c039 Change the way segments, points and handles are selected and deselected.
There is no interdependency anymore, except for selecting a segment selects the point and both handles, and selecting a curve selects both points and handles.

Closes #355
2013-12-08 18:06:31 +01:00
Jürg Lehni
afe00add32 Implement option.type filtering in #hitTest() functions. 2013-12-08 16:32:42 +01:00
Jürg Lehni
2884894d0f Implement hit-testing tolerance for fill tests.
Closes #278.
2013-12-08 12:15:10 +01:00
hkrish
834c8d17a9 Declutter getConvexHull code. 2013-12-08 00:18:47 +01:00
hkrish
baa189bb19 getConvexHull returns upper and lower part of the c-hull seperately 2013-12-08 00:11:13 +01:00
Jürg Lehni
054356c78d Fix drawing of closed path with only one segment. 2013-12-07 16:16:04 +01:00
Jürg Lehni
f166b08257 Simplify addCap() function. 2013-12-07 16:11:02 +01:00
Jürg Lehni
eb1f62b908 Improve strokeBounds fix for paths with only one segment. 2013-12-07 16:07:51 +01:00
msand
e431154e0e Fix indent. 2013-12-07 16:09:50 +02:00
msand
73b1b9843a Wrote failing test for strokeBounds on paths with a single segment and strokeColor. Implemented fix for failing test. 2013-12-07 15:59:45 +02:00
Jürg Lehni
a50adb1020 Implement constructors for Path and CompoundPath that can handle SVG-style path-data. 2013-12-06 18:09:44 +01:00
Jürg Lehni
92590b160c Implement Canvas Path caching again using Context#currentPath. 2013-12-06 12:49:46 +01:00
Jürg Lehni
5f24bf8da5 Implement Rectangle#getArea() and use it in reorientPath() 2013-12-03 21:54:36 +01:00
Jürg Lehni
4926e2c8da Fix Array#sort() call in reorientPath(path) for IE.
IE expects integer values in the compare function, not boolean. Closes #350 again.
2013-12-03 21:49:49 +01:00