From a67797c485e2011cc44fe793ffa42df7e9533eb2 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Fri, 23 Jun 2017 18:29:55 +0800 Subject: [PATCH] Build an identity matrix for InterpolateMatrix. We have to build an identity matrix while add_weighted() between InterpolateMatrix and none transform in some cases, e.g. trigger a transition from a mid-point of another transition to none. --- .../properties/helpers/animated_properties.mako.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 9e25244fe96..476d53c090b 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -1621,20 +1621,19 @@ fn build_identity_transform_list(list: &[TransformOperation]) -> Vec { + TransformOperation::AccumulateMatrix { .. } | + TransformOperation::InterpolateMatrix { .. } => { // Perspective: We convert a perspective function into an equivalent // ComputedMatrix, and then decompose/interpolate/recompose these matrices. - // AccumulateMatrix: We do interpolation on AccumulateMatrix by reading it as a - // ComputedMatrix (with layout information), and then do matrix interpolation. + // AccumulateMatrix/InterpolateMatrix: We do interpolation on + // AccumulateMatrix/InterpolateMatrix by reading it as a ComputedMatrix + // (with layout information), and then do matrix interpolation. // // Therefore, we use an identity matrix to represent the identity transform list. // http://dev.w3.org/csswg/css-transforms/#identity-transform-function let identity = ComputedMatrix::identity(); result.push(TransformOperation::Matrix(identity)); } - TransformOperation::InterpolateMatrix { .. } => { - panic!("Building the identity matrix for InterpolateMatrix is not supported"); - } } }