Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17039] Android: Border radius fails to trim corners off a view

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2014-06-02T18:55:59.000+0000
Affected Version/sRelease 3.3.0
Fix Version/sRelease 3.3.0, Release 3.4.0
ComponentsAndroid
Labelsmodule_views, qe-3.3.0, qe-closed-3.3.0, qe-testadded, regression
ReporterSamuel Dowse
AssigneeHieu Pham
Created2014-05-29T00:25:13.000+0000
Updated2014-06-02T21:21:09.000+0000

Description

Description

A view with a border radius set will not be trimmed by the border. The view will remain square while the border curves. See attached screenshot.

Steps To Reproduce

Copy the following code snippet into your app.js file.
var win = Ti.UI.createWindow({
    backgroundColor : 'green',
    layout:'vertical'
});
 
var view = Ti.UI.createView({
	backgroundColor:'white',
	borderColor:'red',
	borderWidth:15,
	width:150,
	height:150,
	top:10
});

var but1 = Ti.UI.createButton({
	title:"border radius = 10",
	top:20
});

but1.addEventListener('click',function(){
	view.borderRadius = "20";
});

var but2 = Ti.UI.createButton({
	title:"border radius = 20",
	top:20
});

but2.addEventListener('click',function(){
	view.borderRadius = "40";
});
 
win.add(view);
win.add(but1);
win.add(but2); 

win.open();

Expected Result

View should be trimmed by the border

Actual Result

View sticks out from under the border, remaining a square shape. +Extra Information+ This is a regression as it works as expected in 3.2.3.GA

Attachments

FileDateSize
screen.png2014-05-29T00:25:13.000+000075620

Comments

  1. Hieu Pham 2014-05-30

    Regression caused by https://github.com/appcelerator/titanium_mobile/pull/5177
  2. Hieu Pham 2014-05-30

    master PR: https://github.com/appcelerator/titanium_mobile/pull/5746
  3. Vishal Duggal 2014-06-02

    PR merged into master. Needs a backport to 3_3_X
  4. Hieu Pham 2014-06-02

    3.3.X PR: https://github.com/appcelerator/titanium_mobile/pull/5752
  5. Samuel Dowse 2014-06-02

    Verified fixed on: Mac OSX 10.9.3 Appcelerator Studio, build: 3.3.0.201405271647 Titanium SDK, build: 3.3.0.v20140602133312 Titanium CLI, build: 3.3.0-beta2 Alloy: 1.4.0-beta Android Device: Nexus 4 (4.4) Border radius correctly trims the view. Closing.

JSON Source