summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfred ross-perry <fredross-perry@Fred-Ross-Perrys-Computer.local>2016-11-02 12:05:08 -0700
committerTor Andersson <tor.andersson@artifex.com>2016-11-08 20:06:14 +0100
commit15a76c5a9a12f6a21e05f0b8d1ce15a40c42461b (patch)
tree74b7a82edbc8c55ae2c2ec994575b9c0c7c4b756
parenta5f105a2acb853f3bd7a71cb5c4c896dbcbb7480 (diff)
downloadmupdf-15a76c5a9a12f6a21e05f0b8d1ce15a40c42461b.tar.xz
fix iOS app issue where deleted annotations don't properly disappear.
-rw-r--r--platform/ios/Classes/MuPageViewNormal.m48
1 files changed, 25 insertions, 23 deletions
diff --git a/platform/ios/Classes/MuPageViewNormal.m b/platform/ios/Classes/MuPageViewNormal.m
index d9feb540..73a6f756 100644
--- a/platform/ios/Classes/MuPageViewNormal.m
+++ b/platform/ios/Classes/MuPageViewNormal.m
@@ -929,26 +929,32 @@ static void updatePixmap(fz_document *doc, fz_display_list *page_list, fz_displa
return;
dispatch_async(queue, ^{
if (!cancel) {
- printf("render page %d\n", number);
- [self ensureDisplaylists];
- CGSize scale = fitPageToScreen(pageSize, self.bounds.size);
- CGRect rect = (CGRect){{0.0, 0.0},{pageSize.width * scale.width, pageSize.height * scale.height}};
- image_pix = renderPixmap(doc, page_list, annot_list, pageSize, self.bounds.size, rect, 1.0);
- CGDataProviderRelease(imageData);
- imageData = CreateWrappedPixmap(image_pix);
- UIImage *image = newImageWithPixmap(image_pix, imageData);
- widgetRects = enumerateWidgetRects(doc, page);
- [self loadAnnotations];
- dispatch_async(dispatch_get_main_queue(), ^{
- [self displayImage: image];
- [image release];
- });
+ [self renderPage];
} else {
printf("cancel page %d\n", number);
}
});
}
+- (void) renderPage
+{
+ printf("render page %d\n", number);
+ [self ensureDisplaylists];
+ CGSize scale = fitPageToScreen(pageSize, self.bounds.size);
+ CGRect rect = (CGRect){{0.0, 0.0},{pageSize.width * scale.width, pageSize.height * scale.height}};
+ image_pix = renderPixmap(doc, page_list, annot_list, pageSize, self.bounds.size, rect, 1.0);
+ CGDataProviderRelease(imageData);
+ imageData = CreateWrappedPixmap(image_pix);
+ UIImage *image = newImageWithPixmap(image_pix, imageData);
+ widgetRects = enumerateWidgetRects(doc, page);
+ [self loadAnnotations];
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self displayImage: image];
+ [image release];
+ [imageView setNeedsDisplay];
+ });
+}
+
- (void) displayImage: (UIImage*)image
{
if (loadingView) {
@@ -1199,17 +1205,13 @@ static void updatePixmap(fz_document *doc, fz_display_list *page_list, fz_displa
if (isValid)
tileView.image = timage;
[timage release];
+ [tileView setNeedsDisplay];
});
}
- CGSize fscale = fitPageToScreen(pageSize, self.bounds.size);
- CGRect rect = (CGRect){{0.0, 0.0},{pageSize.width * fscale.width, pageSize.height * fscale.height}};
- updatePixmap(doc, page_list, annot_list, image_pix, rlist, pageSize, self.bounds.size, rect, 1.0);
drop_list(rlist);
- UIImage *image = newImageWithPixmap(image_pix, imageData);
- dispatch_async(dispatch_get_main_queue(), ^{
- imageView.image = image;
- [image release];
- });
+
+ // re-render the full-page image
+ [self renderPage];
}
- (void) update
@@ -1381,7 +1383,7 @@ static void updatePixmap(fz_document *doc, fz_display_list *page_list, fz_displa
int changed = [self passTapToPage:ipt];
if (changed)
dispatch_async(dispatch_get_main_queue(), ^{
- [updater update];
+ [self update];
});
});
return [[[MuTapResultWidget alloc] init] autorelease];