[TIMOB-1020] animating view with label causes major flickering
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-04-15T02:41:38.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.4.0 |
Components | iOS |
Labels | n/a |
Reporter | Nolan Wright |
Assignee | Blain Hamon |
Created | 2011-04-15T02:41:38.000+0000 |
Updated | 2017-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
- 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()
- Lee Morris 2017-03-02 Closing as invalid.