protected internal override void applyTransformation(float interpolatedTime, android.view.animation.Transformation t) { float degrees = mFromDegrees + ((mToDegrees - mFromDegrees) * interpolatedTime); float scale = getScaleFactor(); if (mPivotX == 0.0f && mPivotY == 0.0f) { t.getMatrix().setRotate(degrees); } else { t.getMatrix().setRotate(degrees, mPivotX * scale, mPivotY * scale); } }
protected internal override void applyTransformation(float interpolatedTime, android.view.animation.Transformation t) { float sx = 1.0f; float sy = 1.0f; float scale = getScaleFactor(); if (mFromX != 1.0f || mToX != 1.0f) { sx = mFromX + ((mToX - mFromX) * interpolatedTime); } if (mFromY != 1.0f || mToY != 1.0f) { sy = mFromY + ((mToY - mFromY) * interpolatedTime); } if (mPivotX == 0 && mPivotY == 0) { t.getMatrix().setScale(sx, sy); } else { t.getMatrix().setScale(sx, sy, scale * mPivotX, scale * mPivotY); } }
protected internal override void applyTransformation(float interpolatedTime, android.view.animation.Transformation t) { float dx = mFromXDelta; float dy = mFromYDelta; if (mFromXDelta != mToXDelta) { dx = mFromXDelta + ((mToXDelta - mFromXDelta) * interpolatedTime); } if (mFromYDelta != mToYDelta) { dy = mFromYDelta + ((mToYDelta - mFromYDelta) * interpolatedTime); } t.getMatrix().setTranslate(dx, dy); }
/// <summary>Apply this Transformation to an existing Transformation, e.g.</summary> /// <remarks> /// Apply this Transformation to an existing Transformation, e.g. apply /// a scale effect to something that has already been rotated. /// </remarks> /// <param name="t"></param> public virtual void compose(android.view.animation.Transformation t) { mAlpha *= t.getAlpha(); mMatrix.preConcat(t.getMatrix()); }
/// <summary>Clones the specified transformation.</summary> /// <remarks>Clones the specified transformation.</remarks> /// <param name="t">The transformation to clone.</param> public virtual void set(android.view.animation.Transformation t) { mAlpha = t.getAlpha(); mMatrix.set(t.getMatrix()); mTransformationType = t.getTransformationType(); }