Permalink
Browse files

Fix initial position in horizontal mode.

  • Loading branch information...
1 parent 12bcbbe commit ae330dfb94b0ea648132e6a3d14af8d639d81f24 @bjhomer committed Dec 21, 2010
Showing with 9 additions and 9 deletions.
  1. +4 −4 Classes/HSImageSidebarView.m
  2. +5 −5 Sidebar.xcodeproj/project.pbxproj
View
8 Classes/HSImageSidebarView.m
@@ -650,12 +650,12 @@ - (CGRect)imageViewFrameInScrollViewForIndex:(NSUInteger)anIndex {
return CGRectMake(imageOriginX, rowHeight*anIndex + imageOriginY, imageViewWidth, imageViewHeight);
}
else {
- CGFloat rowTallness = _scrollView.bounds.size.height;
- CGFloat imageViewHeight = rowTallness * 3.0 / 4.0;
+ CGFloat scrollerHeight = _scrollView.bounds.size.height;
+ CGFloat imageViewHeight = scrollerHeight * 3.0 / 4.0;
CGFloat imageViewWidth = rowHeight * 3.0 / 4.0;
- CGFloat imageOriginX = (rowTallness - imageViewWidth) / 2.0;
- CGFloat imageOriginY = (rowHeight - imageViewHeight) / 2.0;
+ CGFloat imageOriginX = (rowHeight - imageViewWidth) / 2.0;
+ CGFloat imageOriginY = (scrollerHeight - imageViewHeight) / 2.0;
return CGRectMake(rowHeight*anIndex + imageOriginX, imageOriginY, imageViewWidth, imageViewHeight);
}
View
10 Sidebar.xcodeproj/project.pbxproj
@@ -58,9 +58,9 @@
B7B80534129393C400EBE69D /* InfoPlist.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = InfoPlist.strings; path = en.lproj/SidebarTests/InfoPlist.strings; sourceTree = "<group>"; };
B7B80536129393C400EBE69D /* SidebarTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SidebarTests.h; sourceTree = "<group>"; };
B7B80538129393C400EBE69D /* SidebarTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SidebarTests.m; sourceTree = "<group>"; };
- B7B80547129395F800EBE69D /* HSImageSidebarView.h */ = {isa = PBXFileReference; fileEncoding = 4; path = HSImageSidebarView.h; sourceTree = "<group>"; };
+ B7B80547129395F800EBE69D /* HSImageSidebarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSImageSidebarView.h; sourceTree = "<group>"; };
B7B80548129395F800EBE69D /* HSImageSidebarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSImageSidebarView.m; sourceTree = "<group>"; };
- B7B8054A12939ADD00EBE69D /* HSImageSidebarViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; path = HSImageSidebarViewDelegate.h; sourceTree = "<group>"; };
+ B7B8054A12939ADD00EBE69D /* HSImageSidebarViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSImageSidebarViewDelegate.h; sourceTree = "<group>"; };
B7D4B0B21294F30E00BC0A01 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
@@ -104,7 +104,7 @@
B7B80504129393C300EBE69D /* Classes */ = {
isa = PBXGroup;
children = (
- B7B80546129394EA00EBE69D /* HSSidebarView */,
+ B7B80546129394EA00EBE69D /* HSImageSidebarView */,
B7B8051C129393C400EBE69D /* SidebarAppDelegate.h */,
B7B8051D129393C400EBE69D /* SidebarAppDelegate.m */,
B7B80522129393C400EBE69D /* SidebarViewController.h */,
@@ -171,14 +171,14 @@
path = Tests;
sourceTree = "<group>";
};
- B7B80546129394EA00EBE69D /* HSSidebarView */ = {
+ B7B80546129394EA00EBE69D /* HSImageSidebarView */ = {
isa = PBXGroup;
children = (
B7B80547129395F800EBE69D /* HSImageSidebarView.h */,
B7B80548129395F800EBE69D /* HSImageSidebarView.m */,
B7B8054A12939ADD00EBE69D /* HSImageSidebarViewDelegate.h */,
);
- name = HSSidebarView;
+ name = HSImageSidebarView;
sourceTree = "<group>";
};
/* End PBXGroup section */

0 comments on commit ae330df

Please sign in to comment.