Skip to content

Instantly share code, notes, and snippets.

View Lucashuang0802's full-sized avatar

Lucas Huang Lucashuang0802

  • San Francisco, CA
View GitHub Profile
- (void)drawOnFitModeWithJson:(NSDictionary *)json
path:(OTAnnotationPath *)path {
CGFloat remoteCanvasWidth = [json[@"canvasWidth"] floatValue];
CGFloat remoteCanvasHeight = [json[@"canvasHeight"] floatValue];
CGFloat thisCanvasWidth = CGRectGetWidth(self.annotationScrollView.annotationView.bounds);
CGFloat thisCanvasHeight = CGRectGetHeight(self.annotationScrollView.annotationView.bounds);
// apply scale factor
// Based on this: http://www.iosres.com/index-legacy.html