From 513e2903af470afe89976561e5c4c51fee6bfdce Mon Sep 17 00:00:00 2001 From: Jo Liss Date: Tue, 7 Feb 2012 03:30:48 +0100 Subject: [PATCH] Add scaleX, scaleY, scaleZ properties --- lib/css_hooks.js | 64 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/lib/css_hooks.js b/lib/css_hooks.js index 7860fcd..73b17d6 100644 --- a/lib/css_hooks.js +++ b/lib/css_hooks.js @@ -140,13 +140,73 @@ require('TransformJS/sylvester'); } else { return $M([ - [s, 0,0], - [0, s,0], + [s,0,0], + [0,s,0], [0,0,1] ]); } } }, + scaleX: { + defaultValue: 1, + matrix: function(s) { + if (supports3d) { + return $M([ + [s,0,0,0], + [0,1,0,0], + [0,0,1,0], + [0,0,0,1] + ]); + } + else { + return $M([ + [s,0,0], + [0,1,0], + [0,0,1] + ]); + } + } + }, + scaleY: { + defaultValue: 1, + matrix: function(s) { + if (supports3d) { + return $M([ + [1,0,0,0], + [0,s,0,0], + [0,0,1,0], + [0,0,0,1] + ]); + } + else { + return $M([ + [1,0,0], + [0,s,0], + [0,0,1] + ]); + } + } + }, + scaleZ: { + defaultValue: 1, + matrix: function(s) { + if (supports3d) { + return $M([ + [1,0,0,0], + [0,1,0,0], + [0,0,s,0], + [0,0,0,1] + ]); + } + else { + return $M([ + [1,0,0], + [0,1,0], + [0,0,1] + ]); + } + } + }, translateX: { defaultValue: 0, matrix: function(tx) {