/** Sets this affine transform matrix to {@code other}. * @return this instance, for chaining. */ public AffineTransform set (AffineTransform other) { return setTransform(other.m00, other.m01, other.m10, other.m11, other.tx, other.ty); }
/** Sets this affine transform matrix to {@code other}. * @return this instance, for chaining. */ public AffineTransform set (AffineTransform other) { return setTransform(other.m00, other.m01, other.m10, other.m11, other.tx, other.ty); }
@Override public void willInit (int count) { // concatenate the transform of all layers above our target layer xform.setTransform(1, 0, 0, 1, 0, 0); Layer xlayer = layer; while (xlayer != null) { Transforms.multiply(xlayer.transform(), xform, xform); xlayer = xlayer.parent(); } xform.get(_matrix); } @Override public void init (int index, float[] data, int start) {
/** * Returns the layer's current transformation matrix. If any changes have been made to the * layer's scale, rotation or translation, they will be applied to the transform matrix before it * is returned. * * <p><em>Note:</em> any direct modifications to this matrix <em>except</em> modifications to its * translation, will be overwritten if a call is subsequently made to {@link #setScale(float)}, * {@link #setScale(float,float)}, {@link #setScaleX}, {@link #setScaleY} or {@link #setRotation}. * If you intend to manipulate a layer's transform matrix directly, <em>do not</em> call those * other methods. Also do not expect {@link #scaleX}, {@link #scaleY}, or {@link #rotation} to * reflect the direct changes you've made to the transform matrix. They will not. </p> */ public AffineTransform transform() { if (isSet(Flag.XFDIRTY)) { float sina = FloatMath.sin(rotation), cosa = FloatMath.cos(rotation); float m00 = cosa * scaleX, m01 = sina * scaleX; float m10 = -sina * scaleY, m11 = cosa * scaleY; float tx = transform.tx(), ty = transform.ty(); transform.setTransform(m00, m01, m10, m11, tx, ty); setFlag(Flag.XFDIRTY, false); } return transform; }
float m10 = -sinX * scaleY; float m11 = cosX * scaleY; content.transform().setTransform(m00, m01, m10, m11, locX, locY); content.setOrigin(kf.pivot.x(), kf.pivot.y());