fix seekbar's track bounds.error

This commit is contained in:
houzh 2023-05-06 03:22:16 +00:00
parent 634abe4daa
commit e136aafddf
3 changed files with 4 additions and 6 deletions

View File

@ -719,9 +719,7 @@ static void drawRound(Canvas&canvas,const RectF&r,const std::vector<float>&radii
pts[4]=r.right()-radii[2]; pts[5]=r.bottom()-radii[2];
pts[6]=r.left + radii[3]; pts[7]=r.bottom()-radii[3];
for(int i=0,j=0;i<8;i+=2,j++){
canvas.translate(pts[i],pts[i+1]);
canvas.arc(0,0,radii[j],db*degree,(db+90)*degree);
canvas.translate(-pts[i],-pts[i+1]);
canvas.arc(pts[i],pts[i+1],radii[j],db*degree,(db+90)*degree);
db+=90.f;
}canvas.line_to(pts[0]-radii[0],pts[1]);
}

View File

@ -291,7 +291,7 @@ void AbsSeekBar::updateThumbAndTrackPos(int w, int h) {
if (track) {
const int trackWidth = w - mPaddingRight - mPaddingLeft;
track->setBounds(0, trackOffset, trackWidth, trackOffset + trackHeight);
track->setBounds(0, trackOffset, trackWidth, trackHeight);
}
if (thumb) {

View File

@ -672,7 +672,7 @@ void ProgressBar::updateDrawableBounds(int w,int h){
}
if (mProgressDrawable != nullptr) {
mProgressDrawable->setBounds(0, 0, right-left, bottom-top);
mProgressDrawable->setBounds(0, 0, right, bottom);
}
}