I want to draw a circle (it is more but I have problems with the circle) on a canvas with the View Class.
I have started with this link: http://mindtherobot.com/blog/272/
The onMeasure()
function is the same and I am scaling the same. In my emulator and on my Nexus 7 everything looks perfect but on my LG it isn´t
It looks loke the color of the circle is blurred.
The code is:
protected void onDraw(Canvas canvas) {
float scale = (float) getWidth();
canvas.save(Canvas.MATRIX_SAVE_FLAG);
canvas.scale(scale, scale);
drawCircle(canvas);
canvas.restore();
}
private void drawCircle(Canvas canvas) {
canvas.save(Canvas.MATRIX_SAVE_FLAG);
canvas.drawOval(rimRect, debug);
canvas.restore();
}
private void initDrawingTools() {
float O1x = -0.5f;
float O1y = -0.5f;
float O2x = 0.5f;
float O2y = 0.5f;
rimRect = new RectF(O1x, O1y, O2x, O2y);
debug = new Paint();
debug.setColor(Color.RED);
}