Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void drawHourMinSec(Canvas canvas, double moment, boolean isHour, boolean isSecond) {
- double angle = Math.PI * moment / 30 - Math.PI / 2;
- int handRadius = isHour ? mRadius - mHandTruncation - mHourHandTruncation : mRadius - mHandTruncation;
- float pivotX = (float) (mWidth / 2 + Math.cos(angle) * handRadius);
- float pivotY = (float) (mHeight / 2 + Math.sin(angle) * handRadius);
- setPivotY(pivotY);
- setPivotX(pivotX);
- if (isSecond) mPaint.setColor(Color.RED);
- canvas.drawLine(mWidth / 2, mHeight / 2, pivotX, pivotY, mPaint);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement