Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14680] BlackBerry: failed to convert to float when using values in 'dp'

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-09-20T18:45:56.000+0000
Affected Version/sRelease 3.1.2
Fix Version/s2013 Sprint 19, 2013 Sprint 19 API, Release 3.2.0
ComponentsBlackBerry
Labelsqe-3.1.2, qe-testadded
ReporterFederico Casali
AssigneeRussell McMahon
Created2013-07-26T23:58:33.000+0000
Updated2014-02-19T19:34:52.000+0000

Description

Problem description

On BlackBerry, an error is thrown when using a fontSize expressed in 'dp' and fontSize is not correctly displayed.

Steps to reproduce (Alloy sample)

index.xml
<Alloy>
	<Window class="container">
		<Label id='label1' top='5'>Label using dp</Label>
		<Label id="label2" top='20'>Another Label</Label>
	</Window>
</Alloy>
index.tss
".container": {
	backgroundColor:"white"
}

"Label": {
	width: Ti.UI.SIZE,
	height: Ti.UI.SIZE,
	color: "#000",
	font:{
		fontSize:'55dp'
	}
} 

"#label2":{
	font:{
		fontSize:5
	}
}
index.js
$.index.open();

1. Run the sample code
2. In the console: 
[N_DEBUG] virtual int NativeAbstractTextControlObject::setFont(TiObject*) Line 142: Failed to convert font size to float with value: 55dp
3. On screen, 'label1' size is not reflecting the '55dp' value 

Comments

  1. Russell McMahon 2013-08-07

    https://github.com/appcelerator/titanium_mobile_blackberry/pull/150
  2. Samuel Dowse 2013-11-13

    Verified fixed on: Mac OSX 10.9 Mavericks Titanium Studio, build: 3.2.0.201311122225 Titanium SDK, build: 3.2.0.v20131113094843 CLI: 3.2.0 Alloy: 1.3.0 BlackBerry Simulator: 10.2.0.1791 Label1 font size is set and displaying at 55dp. Label2 font size is set and displaying at 5. Simulator displays both as expected. Closing.

JSON Source