Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filler fix #6989

Merged
merged 2 commits into from
Jan 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions src/plugins/plugin.filler.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ function pointsFromSegments(boundary, line) {
const first = linePoints[segment.start];
const last = linePoints[segment.end];
if (y !== null) {
points.push({x: first.x, y});
points.push({x: last.x, y});
points.push({x: first.x, y, _prop: 'x', _ref: first});
points.push({x: last.x, y, _prop: 'x', _ref: last});
} else if (x !== null) {
points.push({x, y: first.y});
points.push({x, y: last.y});
points.push({x, y: first.y, _prop: 'y', _ref: first});
points.push({x, y: last.y, _prop: 'y', _ref: last});
}
});
return points;
Expand All @@ -184,6 +184,7 @@ function getTarget(source) {
const boundary = computeBoundary(source);
let points = [];
let _loop = false;
let _refPoints = false;

if (boundary instanceof simpleArc) {
return boundary;
Expand All @@ -194,8 +195,15 @@ function getTarget(source) {
points = boundary;
} else {
points = pointsFromSegments(boundary, line);
_refPoints = true;
}
return points.length ? new Line({points, options: {tension: 0}, _loop, _fullLoop: _loop}) : null;
return points.length ? new Line({
points,
options: {tension: 0},
_loop,
_fullLoop: _loop,
_refPoints
}) : null;
}

function resolveTarget(sources, index, propagate) {
Expand Down Expand Up @@ -264,6 +272,17 @@ function _segments(line, target, property) {
const tpoints = target.points;
const parts = [];

if (target._refPoints) {
// Update properties from reference points. (In case those points are animating)
for (let i = 0, ilen = tpoints.length; i < ilen; ++i) {
const point = tpoints[i];
const prop = point._prop;
if (prop) {
point[prop] = point._ref[prop];
}
}
}

for (let segment of line.segments) {
const bounds = getBounds(property, points[segment.start], points[segment.end], segment.loop);

Expand Down