From b2953ca90d1be574d518bcd63d994b1e709b2f1b Mon Sep 17 00:00:00 2001 From: John George Francis Date: Fri, 7 Oct 2022 01:19:58 +0530 Subject: [PATCH 1/2] fix follow_path for objects with start_pos --- src/action_animations.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/action_animations.jl b/src/action_animations.jl index 9f50c97e..d4f74777 100644 --- a/src/action_animations.jl +++ b/src/action_animations.jl @@ -416,9 +416,9 @@ function _follow_path(video, object, action, rel_frame, points; closed = closed) # if t is discrete and not 0.0 take the last point or first if closed if !isfirstframe && isapprox_discrete(t) if closed - translate(points[1]) + translate(points[1] - object.start_pos) else - translate(points[end]) + translate(points[end] - object.start_pos) end return end @@ -426,16 +426,16 @@ function _follow_path(video, object, action, rel_frame, points; closed = closed) t -= floor(t) if isfirstframe # compute the distances only once for performance reasons - action.defs[:p_dist] = polydistances(points, closed = closed) + action.defs[:p_dist] = polydistances(points .- object.start_pos, closed = closed) end if isapprox(t, 0.0, atol = 1e-4) - translate(points[1]) + translate(points[1] - object.start_pos) return end pdist = action.defs[:p_dist] overshootpoint = get_polypoint_at(points, t; pdist = pdist) - translate(overshootpoint) + translate(overshootpoint - object.start_pos) end """ From d6e5e78e84a63da280b85c220b14e95f287df702 Mon Sep 17 00:00:00 2001 From: John George Francis Date: Fri, 7 Oct 2022 01:30:07 +0530 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 910b017b..7fc54a76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - tutorial on partial draw / show creation - Few tests for morphs added - test for partial draw/ show creation +- fix for `follow_path` for objects with `start_pos` other than O ## v0.9.0 (26th of May 2022) - Ability to use Luxor functionality without rendering an animation