How to draw on untransformed context when magnified in CATiledLayer?

I use CATiledLayer to visualize data. By default, the drawLayer function receives a transposed and scaled context, which allows you to aggregate the drawing code of the zoom level and the desired fragment.
However, I would like to use the zoom function to change the horizontal range of the data without actually zooming in.

So far I have received this code:

(void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context {

    /* retrieve the transformation matrix from the context. */
    CGAffineTransform contextTrans = CGContextGetCTM(context); 

    /* Scale the context back, so all items will still have the same size */
    CGContextScaleCTM(context, 1.0/contextTrans.a, 1.0/contextTrans.d); 

    <.. loop through all datapoints ..> {
        /* Transpose the point-centers to the new zoomed context */
        xCoord = xCoord * contextTrans.a;
        yCoord = yCoord * contextTrans.d;
    }
    <.. drawing code ..>
}

, , . ( 1/zoomfactor)
?
, - , ?

+1
1

, , .

+2

All Articles