Merge pull request #43 from BrianPinsard/master

Changed preview dot drawing methods (drawPoint to drawCircle)
This commit is contained in:
Tibor Kaputa 2017-01-19 22:10:26 +01:00 committed by GitHub
commit 7b5940e3ab
1 changed files with 5 additions and 3 deletions

View File

@ -113,11 +113,13 @@ public class MyCanvas extends View {
private void drawPreviewDot(Canvas canvas) { private void drawPreviewDot(Canvas canvas) {
Resources res = getResources(); Resources res = getResources();
mPaint.setStyle(Paint.Style.FILL);
canvas.drawCircle(getWidth() / 2, getHeight() - res.getDimension(R.dimen.preview_dot_offset_y), mPaintOptions.strokeWidth / 2, mPaint);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(Utils.shouldUseWhite(mPaintOptions.color) ? Color.WHITE : Color.BLACK); mPaint.setColor(Utils.shouldUseWhite(mPaintOptions.color) ? Color.WHITE : Color.BLACK);
mPaint.setStrokeWidth(mPaintOptions.strokeWidth + res.getDimension(R.dimen.preview_dot_stroke_size)); mPaint.setStrokeWidth(res.getDimension(R.dimen.preview_dot_stroke_size));
canvas.drawPoint(getWidth() / 2, getHeight() - res.getDimension(R.dimen.preview_dot_offset_y), mPaint); canvas.drawCircle(getWidth() / 2, getHeight() - res.getDimension(R.dimen.preview_dot_offset_y), (mPaintOptions.strokeWidth + res.getDimension(R.dimen.preview_dot_stroke_size)) / 2, mPaint);
changePaint(mPaintOptions); changePaint(mPaintOptions);
canvas.drawPoint(getWidth() / 2, getHeight() - res.getDimension(R.dimen.preview_dot_offset_y), mPaint);
} }
private void changePaint(PaintOptions paintOptions) { private void changePaint(PaintOptions paintOptions) {