mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-30 13:08:07 -06:00
Text animators: Tracking Amount in pixels, Subtract selectors stop at 0, as After Effects
A text animator's Tracking Amount is in pixels in After Effects 2026, not in 1/1000 em like the Character panel's tracking: Amount 30 on every character adds 30 px between neighbours (half before, half after each) at 80 px and at 40 px. And a Subtract range selector over characters the first selector leaves out keeps them at 0 instead of selecting them negatively. With both, the EXPORTER's t8 layer D (Tracking 30 on characters 2-4 by index, Subtract over the last 20 %) puts every glyph where AE does (it ended 88 px short, 1553 vs 1641; now 1641). The "Tracking In" text preset animates 40 -> 0 px (was 400 -> 0 thousandths of an em, about the same at 100 px text); Lottie export writes a style run's tracking (1/1000 em) as pixels for its tracking animator, which Lottie players add in pixels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
83b134cdc8
commit
8ea876914d
@@ -71,6 +71,10 @@ impl Mode {
|
||||
pub fn combine(self, acc: f64, v: f64) -> f64 {
|
||||
let r = match self {
|
||||
Mode::Add => acc + v,
|
||||
// Subtracting more than is selected leaves nothing, not a negative selection (After
|
||||
// Effects 2026: a Subtract selector over unselected characters leaves their
|
||||
// Tracking at 0, EXPORTER read-back t8).
|
||||
Mode::Subtract if acc >= 0.0 => (acc - v).max(0.0),
|
||||
Mode::Subtract => acc - v,
|
||||
Mode::Intersect => acc * v,
|
||||
Mode::Min => acc.min(v),
|
||||
@@ -352,6 +356,9 @@ mod tests {
|
||||
// A lone Subtract inverts.
|
||||
assert_eq!(Mode::Subtract.combine(Mode::Subtract.initial(), 1.0), 0.0);
|
||||
assert_eq!(Mode::Subtract.combine(Mode::Subtract.initial(), 0.0), 1.0);
|
||||
// Subtracting from what is not selected leaves 0, not a negative selection (AE t8).
|
||||
assert_eq!(Mode::Subtract.combine(0.0, 1.0), 0.0);
|
||||
assert_eq!(Mode::Subtract.combine(0.25, 1.0), 0.0);
|
||||
assert_eq!(Mode::from_index(5), Mode::Difference);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user