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 {
CGAffineTransform contextTrans = CGContextGetCTM(context);
CGContextScaleCTM(context, 1.0/contextTrans.a, 1.0/contextTrans.d);
<.. loop through all datapoints ..> {
xCoord = xCoord * contextTrans.a;
yCoord = yCoord * contextTrans.d;
}
<.. drawing code ..>
}
, , . ( 1/zoomfactor)
?
, - , ?