[TIMOB-2143] iOS Crash: infinite loop on createButton top with non-integer value
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:58:13.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 |
Components | iOS |
Labels | crash, createbutton, defect, infinite, ios, loop, math.floor |
Reporter | Thomas Huelbert |
Assignee | Blain Hamon |
Created | 2011-04-15T03:11:45.000+0000 |
Updated | 2011-04-17T01:58:13.000+0000 |
Description
(bug from David Richey, logged by Thomas Huelbert pending creating of account for David.)
Environment
OS 10.6.4, XCode 4.0, iPhone emulator 4.0 SDK, Titanium Desktop
1.2.1, Titanium Mobile 1.4
Steps to reproduce
The following code works:
var pass = Titanium.UI.createButton({
backgroundImage: 'add3_button_pass.png',
title: 'New',
font: {fontWeight:'bold'},
color: '#white',
top: Math.floor(goalBanner.height * 0.15),
height: Math.floor(goalBanner.height * 0.68),
left: Math.floor(platformWidth * 0.86),
width: Math.floor(platformWidth * 0.13),
zIndex: 10
});
You can make it fail by removing the Math.floor(...) from the top: property, thus:
var pass = Titanium.UI.createButton({
backgroundImage: 'add3_button_pass.png',
title: 'New',
font: {fontWeight:'bold'},
color: '#white',
top: (goalBanner.height * 0.15),
height: Math.floor(goalBanner.height * 0.68),
left: Math.floor(platformWidth * 0.86),
width: Math.floor(platformWidth * 0.13),
zIndex: 10
});
Failure mode:
On Launch from Titanium Developer, app loads and then immediately
crashes. ("Application exited from Simulator")
Crash log:
Attachments
File | Date | Size |
---|---|---|
testb_2010-10-21-104137_mpb15.crash | 2011-04-15T03:11:45.000+0000 | 81085 |
This bug is blocking the release of the Math Puzzle sample app.
Way back in http://github.com/appcelerator/titanium_mobile/commit/3b55284ca46dd07e37dd378cabc21150afcb843a#diff-3"> http://github.com/appcelerator/titanium_mobile/commit/3b55284ca46dd... , we made set the frame to be integral. This is what's causing the infinite loop. Is this still valid or should we remove the descendant of this code?
More importantly, the reason we did this was to make everything line up. But there may be times when this is not desired, or that lining things up causes ugly gaps.
(from [08dbb2ffc8b541d0d2e15f30aa20ec0018791f0a]) [#1984 state:fixed-in-qa] [#2143 state:fixed-in-qa] [#1838 state:fixed-in-qa] We no longer try to enforce buttons onto integer boundaries http://github.com/appcelerator/titanium_mobile/commit/08dbb2ffc8b541d0d2e15f30aa20ec0018791f0a"> http://github.com/appcelerator/titanium_mobile/commit/08dbb2ffc8b54...
iPod 3GT 4.2.1, 1.5.0.a899d42