From 300ec26735da6fbc3cb26ded2619bf14ecd1c2c9 Mon Sep 17 00:00:00 2001 From: shastel Date: Mon, 27 Aug 2018 22:19:04 +0300 Subject: [PATCH] Fix rotate3d arguments according to spec --- modules/functions/rotate3d.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/functions/rotate3d.js b/modules/functions/rotate3d.js index 806821a..baa41dd 100644 --- a/modules/functions/rotate3d.js +++ b/modules/functions/rotate3d.js @@ -1,7 +1,9 @@ import isObject from '../utils/isObject' -import applyUnitToNumbers from '../utils/applyUnitToNumbers' +import applyUnitToNumber from '../utils/applyUnitToNumber' -export default function rotate3d(x, y, z) { +export default function rotate3d(x, y, z, a) { const values = isObject(x) ? [ x.x, x.y, x.z ] : [ x, y, z ] - return 'rotate3d(' + applyUnitToNumbers(values, 'deg').join(',') + ')' + const angle = a || x.a + + return `rotate3d(${values.join(',')},${applyUnitToNumber(angle, 'deg')})` }