Hi, I do not draw the pdf page as-is, but I resize and center it so that it fits the screen. How can I re-calculate the position to display the highlights (the yellow areas)?
Basically, if I have an outer frame, an inner frame which lies on the outer, then when I change the outer frame, I can calculate the inner frame to fit in the new outer frame. But your selection.frame seems not to be be what I can use to calculate. (selection.frame depends on the graphic context...) I guess that when I read the code:
for (Selection *s in self.selections)
{
CGContextSaveGState(ctx);
CGContextConcatCTM(ctx, s.transform);
CGContextFillRect(ctx, s.frame);
CGContextRestoreGState(ctx);
}
Hi, I do not draw the pdf page as-is, but I resize and center it so that it fits the screen. How can I re-calculate the position to display the highlights (the yellow areas)?
Basically, if I have an outer frame, an inner frame which lies on the outer, then when I change the outer frame, I can calculate the inner frame to fit in the new outer frame. But your selection.frame seems not to be be what I can use to calculate. (selection.frame depends on the graphic context...) I guess that when I read the code: for (Selection *s in self.selections) { CGContextSaveGState(ctx); CGContextConcatCTM(ctx, s.transform); CGContextFillRect(ctx, s.frame); CGContextRestoreGState(ctx); }