Graphics API: draw circle (#295)

This commit is contained in:
rodo
2017-02-19 14:22:33 +01:00
committed by Emux
parent a6ecab334c
commit 67afa0b7ab
10 changed files with 62 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
/*
* Copyright 2013 Hannes Janetzek
* Copyright 2016 devemux86
* Copyright 2017 nebular
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -61,6 +62,11 @@ public class AndroidCanvas implements Canvas {
canvas.drawBitmap(((AndroidBitmap) bitmap).mBitmap, x, y, null);
}
@Override
public void drawCircle(float x, float y, float radius, Paint paint) {
canvas.drawCircle(x, y, radius, ((AndroidPaint) paint).mPaint);
}
@Override
public void drawLine(int x1, int y1, int x2, int y2, Paint paint) {
canvas.drawLine(x1, y1, x2, y2, ((AndroidPaint) paint).mPaint);

View File

@@ -1,6 +1,7 @@
/*
* Copyright 2010, 2011, 2012 mapsforge.org
* Copyright 2016 devemux86
* Copyright 2017 nebular
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -139,6 +140,16 @@ class AndroidPaint implements Paint {
return mPaint.getStrokeWidth();
}
@Override
public Style getStyle() {
switch (mPaint.getStyle()) {
case STROKE:
return Style.STROKE;
default:
return Style.FILL;
}
}
@Override
public float getTextHeight(String text) {
mPaint.getTextBounds(text, 0, text.length(), rect);