Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongwuzw committed Nov 19, 2024
1 parent e9fc02c commit 1d87c89
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function _validateTransforms(transform: Array<Object>): void {
const value = transformation[key];
if (key === 'matrix' && transform.length > 1) {
console.error(
'You must only specify exactly one matrix per transform object. Passed transform: ' +
'When using a matrix transform, you must specify exactly one transform object. Passed transform: ' +
stringifySafe(transform),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,16 @@ Transform BaseViewProps::resolveTransform(
return transformMatrix;
}

for (const auto& operation : transform.operations) {
transformMatrix = transformMatrix *
Transform::FromTransformOperation(
operation, layoutMetrics.frame.size, transform);
// transform is matrix
if (transform.operations.size() == 1 &&
transform.operations[0].type == TransformOperationType::Arbitrary) {
transformMatrix = transform;
} else {
for (const auto& operation : transform.operations) {
transformMatrix = transformMatrix *
Transform::FromTransformOperation(
operation, layoutMetrics.frame.size, transform);
}
}

if (transformOrigin.isSet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ Transform Transform::FromTransformOperation(
transformOperation.y.resolve(0),
transformOperation.z.resolve(0));
}
// when using arbitrary transform, the caller is responsible for applying the
// value
if (transformOperation.type == TransformOperationType::Arbitrary) {
auto arbitraryTransform = Transform{};
arbitraryTransform.operations.push_back(transformOperation);
Expand Down

0 comments on commit 1d87c89

Please sign in to comment.