Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1020] animating view with label causes major flickering

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2011-04-15T02:41:38.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.4.0
ComponentsiOS
Labelsn/a
ReporterNolan Wright
AssigneeBlain Hamon
Created2011-04-15T02:41:38.000+0000
Updated2017-03-02T18:59:44.000+0000

Description

http://helpdesk.appcelerator.net/tickets/2710">http://helpdesk.appcelerator.net/tickets/2710

code:

var win = Ti.UI.createWindow();

var tw = '100'; 
var tl = '100'; 
var circlez = Ti.UI.createView({ 
borderRadius:(tw/2),borderWidth:1,borderColor:'#336699', 
backgroundColor:'#fffccc', 
width:tw, 
height:tl, 
left:5, 
top:5 
});

var labelz = Ti.UI.createLabel({ 
color:'#000000', 
text:'Table z', 
font:{fontSize:20,fontFamily:'Helvetica Neue'}, 
textAlign:'center', 
width:'auto' 
});

circlez.add(labelz);

circlez.addEventListener('touchmove', function(e) 
{ 
//do soemthing 
circlez.animate({center:{x:e.x,y:e.y}, duration:1}); 
}); 
win.add(circlez);
win.open()

Comments

  1. Stephen Tramer 2011-04-15

    Blain pointed out the issue with this when he fixed the basic_animation.js test. We have to adjust the given coordinates back from the event, because they're relative to the view they're contained in.

       var win = Ti.UI.createWindow();
       
       var tw = '100'; 
       var tl = '100'; 
       var circlez = Ti.UI.createView({ 
       borderRadius:(tw/2),borderWidth:1,borderColor:'#336699', 
       backgroundColor:'#fffccc', 
       width:tw, 
       height:tl, 
       left:5, 
       top:5 
       });
       
       var labelz = Ti.UI.createLabel({ 
       color:'#000000', 
       text:'Table z', 
       font:{fontSize:20,fontFamily:'Helvetica Neue'}, 
       textAlign:'center', 
       width:'auto' 
       });
       
       circlez.add(labelz);
       
       circlez.addEventListener('touchmove', function(e) 
       { 
       //do soemthing 
       Ti.API.log("Coordinates: "+e.x+","+e.y);
           var newX = e.x + circlez.animatedCenter.x - circlez.width/2; 
           var newY = e.y + circlez.animatedCenter.y - circlez.height/2; 
           Ti.API.log("New coordinates:"+newX+","+newY);
       circlez.animate({center:{x:newX,y:newY}, duration:1}); 
       }); 
       win.add(circlez);
       win.open()
       
  2. Lee Morris 2017-03-02

    Closing as invalid.

JSON Source