@Override
    public void setBitmapShaderShift(Point origin) {
        Shader shader = this.paint.getShader();
        if (shader != null) {
            int relativeDx = ((int) -origin.x) % this.shaderWidth;
            int relativeDy = ((int) -origin.y) % this.shaderHeight;

            Matrix localMatrix = new Matrix();
            localMatrix.setTranslate(relativeDx, relativeDy);
            shader.setLocalMatrix(localMatrix);
        }
    }
@ Override public void setBitmapShaderShift ( Point origin ) { Shader shader = this . paint . getShader ( ) ; if ( shader != null ) { int relativeDx = ( ( int ) - origin . x ) % this . shaderWidth ; int relativeDy = ( ( int ) - origin . y ) % this . shaderHeight ; Matrix localMatrix = new Matrix ( ) ; localMatrix . setTranslate ( relativeDx , relativeDy ) ; shader . setLocalMatrix ( localMatrix ) ; } }
Shifts the bitmap pattern so that it will always start at a multiple of
itself for any tile the pattern is used. This ensures that regardless of
size of the pattern it tiles correctly.

@param origin the reference point