Skip to content

Commit

Permalink
unit assert in interpolate
Browse files Browse the repository at this point in the history
  • Loading branch information
intergalacticspacehighway committed Mar 30, 2024
1 parent 5a6f86e commit 9ac7106
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,16 @@ Transform Transform::Interpolate(
: Transform::DefaultTransformOperation(type));
react_native_assert(type == lhsOp.type);
react_native_assert(type == rhsOp.type);
react_native_assert(lhsOp.x.unit == rhsOp.x.unit);
react_native_assert(lhsOp.y.unit == rhsOp.y.unit);
react_native_assert(lhsOp.z.unit == rhsOp.z.unit);

result = result *
Transform::FromTransformOperation(TransformOperation{
type,
ValueUnit(lhsOp.x.value + (rhsOp.x.value - lhsOp.x.value) * animationProgress, UnitType::Point),
ValueUnit(lhsOp.y.value + (rhsOp.y.value - lhsOp.y.value) * animationProgress, UnitType::Point),
ValueUnit(lhsOp.z.value + (rhsOp.z.value - lhsOp.z.value) * animationProgress, UnitType::Point)}, size);
ValueUnit(lhsOp.x.value + (rhsOp.x.value - lhsOp.x.value) * animationProgress, lhsOp.x.unit),
ValueUnit(lhsOp.y.value + (rhsOp.y.value - lhsOp.y.value) * animationProgress, lhsOp.y.unit),
ValueUnit(lhsOp.z.value + (rhsOp.z.value - lhsOp.z.value) * animationProgress, lhsOp.z.unit)}, size);
}

return result;
Expand Down

0 comments on commit 9ac7106

Please sign in to comment.