Loading core/java/android/widget/AbsSeekBar.java +2 −2 Original line number Diff line number Diff line Loading @@ -467,8 +467,8 @@ public abstract class AbsSeekBar extends ProgressBar { final Rect bounds = thumb.getBounds(); final int offsetX = mPaddingLeft - mThumbOffset; final int offsetY = mPaddingTop; background.setHotspotBounds(left + offsetX, bounds.top + offsetY, right + offsetX, bounds.bottom + offsetY); background.setHotspotBounds(left + offsetX, top + offsetY, right + offsetX, bottom + offsetY); } // Canvas will be translated, so 0,0 is where we start drawing Loading graphics/java/android/graphics/drawable/Ripple.java +6 −4 Original line number Diff line number Diff line Loading @@ -142,14 +142,16 @@ class Ripple { } private void clampStartingPosition() { final float dX = mStartingX - mBounds.exactCenterX(); final float dY = mStartingY - mBounds.exactCenterY(); final float cX = mBounds.exactCenterX(); final float cY = mBounds.exactCenterY(); final float dX = mStartingX - cX; final float dY = mStartingY - cY; final float r = mOuterRadius; if (dX * dX + dY * dY > r * r) { // Point is outside the circle, clamp to the circumference. final double angle = Math.atan2(dY, dX); mClampedStartingX = (float) (Math.cos(angle) * r); mClampedStartingY = (float) (Math.sin(angle) * r); mClampedStartingX = cX + (float) (Math.cos(angle) * r); mClampedStartingY = cY + (float) (Math.sin(angle) * r); } else { mClampedStartingX = mStartingX; mClampedStartingY = mStartingY; Loading Loading
core/java/android/widget/AbsSeekBar.java +2 −2 Original line number Diff line number Diff line Loading @@ -467,8 +467,8 @@ public abstract class AbsSeekBar extends ProgressBar { final Rect bounds = thumb.getBounds(); final int offsetX = mPaddingLeft - mThumbOffset; final int offsetY = mPaddingTop; background.setHotspotBounds(left + offsetX, bounds.top + offsetY, right + offsetX, bounds.bottom + offsetY); background.setHotspotBounds(left + offsetX, top + offsetY, right + offsetX, bottom + offsetY); } // Canvas will be translated, so 0,0 is where we start drawing Loading
graphics/java/android/graphics/drawable/Ripple.java +6 −4 Original line number Diff line number Diff line Loading @@ -142,14 +142,16 @@ class Ripple { } private void clampStartingPosition() { final float dX = mStartingX - mBounds.exactCenterX(); final float dY = mStartingY - mBounds.exactCenterY(); final float cX = mBounds.exactCenterX(); final float cY = mBounds.exactCenterY(); final float dX = mStartingX - cX; final float dY = mStartingY - cY; final float r = mOuterRadius; if (dX * dX + dY * dY > r * r) { // Point is outside the circle, clamp to the circumference. final double angle = Math.atan2(dY, dX); mClampedStartingX = (float) (Math.cos(angle) * r); mClampedStartingY = (float) (Math.sin(angle) * r); mClampedStartingX = cX + (float) (Math.cos(angle) * r); mClampedStartingY = cY + (float) (Math.sin(angle) * r); } else { mClampedStartingX = mStartingX; mClampedStartingY = mStartingY; Loading