Added SetZ Action and exposed via Group

This commit is contained in:
Richard Davey 2017-06-28 14:16:01 +01:00
parent 98bb99f268
commit 2f605250b3
3 changed files with 21 additions and 0 deletions

13
v3/src/actions/SetZ.js Normal file
View file

@ -0,0 +1,13 @@
var SetZ = function (items, value, step)
{
if (step === undefined) { step = 0; }
for (var i = 0; i < items.length; i++)
{
items[i].z = value + (i * step);
}
return items;
};
module.exports = SetZ;

View file

@ -36,6 +36,7 @@ module.exports = {
SetX: require('./SetX'),
SetXY: require('./SetXY'),
SetY: require('./SetY'),
SetZ: require('./SetZ'),
ShiftPosition: require('./ShiftPosition'),
SmootherStep: require('./SmootherStep'),
SmoothStep: require('./SmoothStep'),

View file

@ -430,6 +430,13 @@ var Group = new Class({
return this;
},
setZ: function (value, step)
{
Actions.SetZ(this.children.entries, value, step);
return this;
},
shiftPosition: function (x, y, direction, output)
{
Actions.ShiftPosition(this.children.entries, x, y, direction, output);