mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-10 21:19:10 -04:00
Simplify CurveLocation data structures.
Directly creating and linking intersections simplifies things a lot.
This commit is contained in:
parent
78e0bae6aa
commit
04452730dd
5 changed files with 74 additions and 90 deletions
src/path
|
@ -110,11 +110,13 @@ var PathItem = Item.extend(/** @lends PathItem# */{
|
|||
startConnected: length1 === 1,
|
||||
// After splitting, the end is always connected:
|
||||
endConnected: true,
|
||||
adjust: function(loc) {
|
||||
reparametrize: function(t1, t2) {
|
||||
// Since the curve was split above, we need to
|
||||
// adjust the parameters for both locations.
|
||||
loc._parameter /= 2;
|
||||
loc._parameter2 = 0.5 + loc._parameter2 / 2;
|
||||
return {
|
||||
t1: t1 / 2,
|
||||
t2: (1 + t2) / 2
|
||||
};
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue