Permalink
Browse files

Merge pull request #42 from JeffEnglish/MOD-757

[MOD-757] CustomPopover: Constrain the arrow position to the bounds of t...
  • Loading branch information...
Jeff English
Jeff English committed Jun 29, 2012
2 parents 8dcc18c + 32d4de7 commit 2d5270b37169f14cb153a8c9b475c7d38f60845a
@@ -60,8 +60,8 @@ - (void)layoutSubviews
arrowFrame.size = [arrowImage size];
[arrowView setImage:arrowImage];
arrowFrame.origin.y=0;
- arrowFrame.origin.x=imageFrame.size.width/2 - arrowBase/2 + offset;
-
+ arrowFrame.origin.x=MAX(MIN(imageFrame.size.width/2 - arrowBase/2 + offset,imageFrame.size.width-arrowFrame.size.width),0);
+
imageFrame.origin.y += arrowHeight;
imageFrame.size.height -= arrowHeight;
break;
@@ -71,8 +71,8 @@ - (void)layoutSubviews
arrowFrame.size = [arrowImage size];
[arrowView setImage:arrowImage];
arrowFrame.origin.y=imageFrame.size.height - arrowFrame.size.height;
- arrowFrame.origin.x=imageFrame.size.width/2 - arrowBase/2 + offset;
-
+ arrowFrame.origin.x=MAX(MIN(imageFrame.size.width/2 - arrowBase/2 + offset,imageFrame.size.width-arrowFrame.size.width),0);
+
imageFrame.size.height -= arrowHeight;
break;
@@ -81,8 +81,8 @@ - (void)layoutSubviews
arrowFrame.size = [arrowImage size];
[arrowView setImage:arrowImage];
arrowFrame.origin.x=0;
- arrowFrame.origin.y=imageFrame.size.height/2 - arrowBase/2 + offset;
-
+ arrowFrame.origin.y=MAX(MIN(imageFrame.size.height/2 - arrowBase/2 + offset,imageFrame.size.height-arrowFrame.size.height),0);
+
imageFrame.origin.x += arrowHeight;
imageFrame.size.width -= arrowHeight;
break;
@@ -92,13 +92,13 @@ - (void)layoutSubviews
arrowFrame.size = [arrowImage size];
[arrowView setImage:arrowImage];
arrowFrame.origin.x=imageFrame.size.width - arrowFrame.size.width;
- arrowFrame.origin.y=imageFrame.size.height/2 - arrowBase/2 + offset;
-
+ arrowFrame.origin.y=MAX(MIN(imageFrame.size.height/2 - arrowBase/2 + offset,imageFrame.size.height-arrowFrame.size.height),0);
+
imageFrame.size.width -= arrowHeight;
break;
}
-
+
[arrowView setFrame:arrowFrame];
[imageView setFrame:imageFrame];
}
@@ -159,9 +159,6 @@ def glob_libfiles():
return files
def build_module(manifest,config):
- from tools import ensure_dev_path
- ensure_dev_path()
-
rc = os.system("xcodebuild -sdk iphoneos -configuration Release")
if rc != 0:
die("xcodebuild failed")
@@ -0,0 +1,5 @@
+# Change Log
+<pre>
+v0.2 [MOD-757] Constrain the arrow position to the bounds of the popover
+
+v0.1 Initial Release
@@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
-version: 0.1
+version: 0.2
description: Custom ipad popover
author: Blain Hamon
license: Apache Public License v2
Binary file not shown.
Binary file not shown.

0 comments on commit 2d5270b

Please sign in to comment.