mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-11 03:43:43 +00:00
address review: span distance with abs_diff
This commit is contained in:
@@ -238,7 +238,7 @@ fn stroke(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
}
|
||||
// `RotoData::add` would clip the span short of this frame and keep a stroke that never takes effect.
|
||||
if let Some(base) = data_of(g).base
|
||||
&& (frame - base).abs() > MAX_SPAN_FRAMES
|
||||
&& frame.abs_diff(base) > MAX_SPAN_FRAMES.unsigned_abs()
|
||||
{
|
||||
return Err(bad(cmd, format!("frame {frame} is more than {MAX_SPAN_FRAMES} frames from the base frame {base}")));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user