Skip to content

Commit ffbf67c

Browse files
committed
using bound's height / 2 to orient caption
1 parent cd41dff commit ffbf67c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

OpenFlow/AFOpenFlowConstants.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@
4040
#define CAPTION_WIDTH 200
4141
#define CAPTION_HEIGHT 50
4242
#define CAPTION_FONTSIZE 20
43-
#define CAPTION_OFFSET 10
43+
#define CAPTION_OFFSET 20

OpenFlow/AFOpenFlowView.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ - (void)layoutSubviews
259259
}
260260

261261
CGFloat horizOrigin = contentOffset.x + halfScreenWidth - CAPTION_WIDTH / 2;
262-
CGFloat vertOrigin = selectedCoverView.frame.origin.y + selectedCoverView.frame.size.width + CAPTION_OFFSET;
262+
CGFloat vertOrigin = selectedCoverView.frame.origin.y + selectedCoverView.frame.size.height / 2.0 + CAPTION_OFFSET;
263263
selectedCoverCaption.frame = CGRectMake(horizOrigin, vertOrigin, CAPTION_WIDTH, CAPTION_HEIGHT);
264264
selectedCoverCaption.text = [NSString stringWithFormat:@"%@", [coverImageCaptions objectForKey:[NSNumber numberWithInt:targetCover]]];
265265
// put it on top
@@ -570,4 +570,4 @@ - (void)setSelectedCover:(int)newSelectedCover {
570570
[self notifyCoverSelection];
571571
}
572572

573-
@end
573+
@end

0 commit comments

Comments
 (0)