Skip to content

Commit

Permalink
fix getWidth() sometime return 0 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gaopengfei committed Sep 13, 2016
1 parent e3b3cd2 commit 0a5d306
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/main/java/io/feeeei/circleseekbar/CircleSeekBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,9 @@ private void refershPosition() {

private float calcXLocationInWheel(double angle, double cos) {
if (angle < 180) {
return (float) (getWidth() / 2 + Math.sqrt(1 - cos * cos) * mUnreachedRadius);
return (float) (getMeasuredWidth() / 2 + Math.sqrt(1 - cos * cos) * mUnreachedRadius);
} else {
return (float) (getWidth() / 2 - Math.sqrt(1 - cos * cos) * mUnreachedRadius);
return (float) (getMeasuredWidth() / 2 - Math.sqrt(1 - cos * cos) * mUnreachedRadius);
}
}

Expand Down

0 comments on commit 0a5d306

Please sign in to comment.