From 233a5ccef8e34c8946b344e212cd38642300e820 Mon Sep 17 00:00:00 2001 From: Shagen Ogandzhanian Date: Wed, 18 Aug 2021 21:51:50 +0200 Subject: [PATCH] Introduce CSS transformation function scale3d --- .../jetbrains/compose/web/css/properties/transform.kt | 1 + web/core/src/jsTest/kotlin/css/TransformTests.kt | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/properties/transform.kt b/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/properties/transform.kt index df84b323fa..5267b0eda1 100644 --- a/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/properties/transform.kt +++ b/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/properties/transform.kt @@ -30,6 +30,7 @@ fun rotateZ(a: CSSAngleValue) = TransformFunction { "rotateZ($a)" } fun scaleTransform(sx: Number) = TransformFunction { "scale($sx)" } fun scaleTransform(sx: Number, sy: Number) = TransformFunction { "scale($sx, $sy)" } +fun scale3dTransform(sx: Number, sy: Number, sz: Number) = TransformFunction { "scale3d($sx, $sy, $sz)" } fun StyleBuilder.transform(transformFunction: TransformFunction) { property("transform", transformFunction.apply()) diff --git a/web/core/src/jsTest/kotlin/css/TransformTests.kt b/web/core/src/jsTest/kotlin/css/TransformTests.kt index 19a3bdf1b7..a9a7593f6d 100644 --- a/web/core/src/jsTest/kotlin/css/TransformTests.kt +++ b/web/core/src/jsTest/kotlin/css/TransformTests.kt @@ -107,4 +107,14 @@ class TransformTests { assertEquals("scale(0.2, 0.3)", nextChild().style.transform) } + @Test + fun scale3d() = runTest { + composition { + Div({ style { transform(scale3dTransform(0.2, 0.3, 0.1)) } }) + } + + assertEquals("scale3d(0.2, 0.3, 0.1)", nextChild().style.transform) + } + + } \ No newline at end of file