mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-11-29 18:59:14 +08:00
remove rect.inflate ,use android's rect.inset
This commit is contained in:
parent
ac84da29bb
commit
e839f09a1f
@ -5,10 +5,12 @@ void onClick(View&v){
|
||||
View*hello=root->findViewById(0x12345);
|
||||
hello->setLayerType(View::LAYER_TYPE_SOFTWARE);
|
||||
LOGD("click %d",v.getId());
|
||||
int* tag=(int*)v.getTag();
|
||||
switch(v.getId()){
|
||||
case 1:hello->animate().alpha(0.2f).setDuration(2000).start();break;
|
||||
case 2:hello->animate().x(-600).setDuration(2000).start();break;
|
||||
case 1:hello->animate().alpha(0.2f).setDuration(1000).start();break;
|
||||
case 2:hello->animate().x(tag==0?-600:0).setDuration(1000).start();break;
|
||||
}
|
||||
v.setTag((tag==0)?(void*)1:(void*)0);
|
||||
}
|
||||
int main(int argc,const char*argv[]){
|
||||
App app(argc,argv);
|
||||
|
@ -52,13 +52,6 @@ struct CRect{
|
||||
height=h;
|
||||
}
|
||||
|
||||
void inflate(T dx,T dy){
|
||||
left-=dx;
|
||||
top-=dy;
|
||||
width+=(dx+dx);
|
||||
height+=(dy+dy);
|
||||
}
|
||||
|
||||
void inset(T dx,T dy){
|
||||
left +=dx;
|
||||
top +=dy;
|
||||
|
@ -45,7 +45,7 @@ namespace cdroid{
|
||||
|
||||
// Draw the track and the scroll bar.
|
||||
mRect = bounds;
|
||||
mRect.inflate(-thumbWidth /2,0);
|
||||
mRect.inset(thumbWidth/2,0);//inflate(-thumbWidth /2,0);
|
||||
|
||||
const double radius = double(mRect.width)/2.0;
|
||||
canvas.save();
|
||||
|
Loading…
Reference in New Issue
Block a user