Code example for Transformation

Methods: compose, getMatrix

0
    protected void renderChild(GLRootView root, GL11 gl, GLView component) {
        int xoffset = component.mBounds.left - mScrollX;
        int yoffset = component.mBounds.top - mScrollY;
 
        Transformation transform = root.getTransformation();
        Matrix matrix = transform.getMatrix();
        matrix.preTranslate(xoffset, yoffset);
 
        Animation anim = component.mAnimation;
        if (anim != null) {
            long now = root.currentAnimationTimeMillis();
            Transformation temp = root.obtainTransformation();
            if (!anim.getTransformation(now, temp)) {
                component.mAnimation = null;
            } 
            invalidate(); 
            root.pushTransform();
            transform.compose(temp);
            root.freeTransformation(temp);
        } 
        component.render(root, gl);
        if (anim != null) root.popTransform();
        matrix.preTranslate(-xoffset, -yoffset);