image - iOS CATiledLayer and TilingView scale problems? -
i using tilingview apple photoscroller example tile images. works great of images, have few weird scale values. set level of detail 4. images scaled @ different values, 100,50,25,12.5 scales tiled 256x256 @ levels.
in tilingview drawrect method, scale here must 1 of 4 values , 1.0,0.50,0.25,0.125. since store images off based on these scale values when weird scale value breaks , cannot load images. example have image @ .50 scale actual value 0.499798.
any ideas whats going on here? if tell catiledlayer have 4 levels of detail, how end these weird values?
cgfloat scale = cgcontextgetctm(context).a; nslog(@"scale = %f",scale); catiledlayer *tiledlayer = (catiledlayer *)[self layer]; cgsize tilesize = tiledlayer.tilesize;
how can ensure image size pass return me 1 of 4 scales 100,50,25,12,5 image size specify?
there several bugs in sample's code, 1 of involves proper rounding of scale values, leads issue seeing. there other subtle issues. please have @ this question, issues (and fixes) described in more detail.
Comments
Post a Comment