Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ARTiledImageView.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "ARTiledImageView"
s.version = "1.2.0"
s.version = "1.2.2"
s.summary = "Display, pan and deep zoom with tiled images."
s.description = "Display, pan and deep zoom with tiled images on iOS."
s.homepage = "https://github.com/dblock/ARTiledImageView"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.2.3 (06/27/2018)

* Runs the thread sanitizer and addresses any non-main thread issues - (@orta)[http://github.com/orta]

## 1.2.2 (05/11/2014)

* Use code from PSTCenteredScrollView for centering when scrolling out - (@orta)[http://github.com/orta]
Expand Down
18 changes: 15 additions & 3 deletions Classes/ARTiledImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ @interface ARTiledImageView ()
@property (nonatomic, assign) NSInteger maxLevelOfDetail;
@property (atomic, strong, readonly) NSCache *tileCache;
@property (atomic, readonly) NSMutableDictionary *downloadOperations;
@property (nonatomic, assign) CGRect threadSafeBounds;
@end

@implementation ARTiledImageView
Expand Down Expand Up @@ -57,6 +58,17 @@ - (id)initWithDataSource:(NSObject <ARTiledImageViewDataSource> *)dataSource min
return self;
}

- (void)setBounds:(CGRect)bounds
{
[super setBounds:bounds];
_threadSafeBounds = bounds;
}

- (void)setFrame:(CGRect)frame
{
[super setBounds:frame];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be invoking the wrong super class’ method.

_threadSafeBounds = self.bounds;
}

- (void)drawRect:(CGRect)rect
{
Expand All @@ -71,8 +83,7 @@ - (void)drawRect:(CGRect)rect
CGFloat _scaleX = CGContextGetCTM(context).a;
CGFloat _scaleY = CGContextGetCTM(context).d;

CATiledLayer *tiledLayer = (CATiledLayer *) [self layer];
CGSize tileSize = tiledLayer.tileSize;
CGSize tileSize = [self.dataSource tileSizeForImageView:self];;

//
// Even at scales lower than 100%, we are drawing into a rect in the coordinate system of the full
Expand Down Expand Up @@ -108,8 +119,9 @@ - (void)drawRect:(CGRect)rect

NSString *tileCacheKey = [NSString stringWithFormat:@"%@/%@_%@", @(level), @(col), @(row)];
ARTile *tile = [self.tileCache objectForKey:tileCacheKey];

if (!tile) {
tileRect = CGRectIntersection(self.bounds, tileRect);
tileRect = CGRectIntersection(self.threadSafeBounds, tileRect);
tile = [[ARTile alloc] initWithImage:tileImage rect:tileRect];
[self.tileCache setObject:tile forKey:tileCacheKey cost:level];
}
Expand Down
134 changes: 41 additions & 93 deletions Demo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Demo/ARTiledImageDemoViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2014 Artsy. All rights reserved.
//

#import "ARTiledImageScrollView.h"
@class ARTiledImageScrollView;

@interface ARTiledImageDemoViewController : UIViewController

Expand Down
7 changes: 4 additions & 3 deletions Demo/ARTiledImageDemoViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
//

#import "ARTiledImageDemoViewController.h"
#import "ARTiledImageScrollView.h"
#import "ARWebTiledImageDataSource.h"
#import "ARLocalTiledImageDataSource.h"

#import <ARTiledImageView/ARTiledImageScrollView.h>
#import <ARTiledImageView/ARWebTiledImageDataSource.h>
#import <ARTiledImageView/ARLocalTiledImageDataSource.h>

@interface ARTiledImageDemoViewController ()
@property (nonatomic, readonly) NSObject<ARTiledImageViewDataSource> *dataSource;
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source 'https://rubygems.org'

gem 'cocoapods', '0.39.0'
gem 'cocoapods'
2 changes: 1 addition & 1 deletion IntegrationTests/IntegrationTests-Prefix.pch
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
#define EXP_SHORTHAND
#include <Specta/Specta.h>
#include <Expecta/Expecta.h>
#include <Expecta_Snapshots/EXPMatchers+FBSnapshotTest.h>
#include <Expecta+Snapshots/EXPMatchers+FBSnapshotTest.h>

#endif
18 changes: 11 additions & 7 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
workspace 'ARTiledImageView'
inhibit_all_warnings!

pod 'ARTiledImageView', :path => 'ARTiledImageView.podspec'
target "Demo" do
pod 'ARTiledImageView', :path => 'ARTiledImageView.podspec'

target 'IntegrationTests' do
pod 'Specta'
pod 'Expecta'
pod 'FBSnapshotTestCase'
pod 'Expecta+Snapshots'
target 'IntegrationTests' do
inherit! :search_paths

pod 'Specta'
pod 'Expecta'
pod 'FBSnapshotTestCase', :subspecs => ["Core"]
pod 'Expecta+Snapshots'
end
end

use_frameworks!
26 changes: 16 additions & 10 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,40 @@ PODS:
- ARTiledImageView (1.2.0):
- SDWebImage/Core
- Expecta (1.0.5)
- Expecta+Snapshots (2.0.0):
- "Expecta+Snapshots (2.0.0)":
- Expecta (~> 1.0)
- FBSnapshotTestCase/Core (~> 2.0.3)
- FBSnapshotTestCase (2.0.7):
- FBSnapshotTestCase/SwiftSupport (= 2.0.7)
- FBSnapshotTestCase/Core (2.0.7)
- FBSnapshotTestCase/SwiftSupport (2.0.7):
- FBSnapshotTestCase/Core
- SDWebImage/Core (3.7.5)
- Specta (1.0.5)

DEPENDENCIES:
- ARTiledImageView (from `ARTiledImageView.podspec`)
- Expecta
- Expecta+Snapshots
- FBSnapshotTestCase
- "Expecta+Snapshots"
- FBSnapshotTestCase/Core
- Specta

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- Expecta
- "Expecta+Snapshots"
- FBSnapshotTestCase
- SDWebImage
- Specta

EXTERNAL SOURCES:
ARTiledImageView:
:path: ARTiledImageView.podspec

SPEC CHECKSUMS:
ARTiledImageView: 2db7735f5d3fcb4c859c912834a6a1bf20716377
ARTiledImageView: ddbd6bdd1f660fcd0156ada0229c0f3e226427d4
Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe
Expecta+Snapshots: 29b38dd695bc72a0ed2bea833937d78df41943ba
"Expecta+Snapshots": 29b38dd695bc72a0ed2bea833937d78df41943ba
FBSnapshotTestCase: 7e85180d0d141a0cf472352edda7e80d7eaeb547
SDWebImage: 69c6303e3348fba97e03f65d65d4fbc26740f461
Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2

COCOAPODS: 0.39.0
PODFILE CHECKSUM: 03e80ea7e7a670be3fab7b0f8ae3406bf6578afe

COCOAPODS: 1.5.3
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Demo

![animated](Screenshots/goya3.gif)
![animated](https://github.com/dblock/ARTiledImageView/raw/master/Screenshots/goya3.gif)

[Francisco De Goya Y Lucientes, Señora Sabasa Garcia, ca. 1806/1811](https://artsy.net/artwork/francisco-jose-de-goya-y-lucientes-senora-sabasa-garcia), courtesy of the National Gallery of Art, Washington D.C., via [Artsy](https://artsy.net).

Expand Down