Hello,
I think I hit a nasty bug. The problem is that nearly horizontal lines
with a slight gradient and using a Paint with StrokeWidth = 1 are not
plotted, for example:
public class MyControl extends View {
public MyControl(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
@Override
protected void onDraw(Canvas canvas)
{
super.onDraw(canvas);
Paint pen = new Paint();
pen.setColor(Color.RED);
pen.setStrokeWidth(1);
pen.setStyle(Paint.Style.STROKE);
canvas.drawLine(100, 100, 200, 90, pen); //not painted
canvas.drawLine(100, 100, 200, 100, pen);
canvas.drawLine(100, 100, 200, 110, pen); //not painted
canvas.drawLine(100, 100, 200, 120, pen); //not painted
canvas.drawLine(100, 100, 200, 130, pen);
pen.Color = Color.MAGENTA;
pen.setStrokeWidth(2);
canvas.drawLine(100, 200, 200, 190, pen);
canvas.drawLine(100, 200, 200, 200, pen);
canvas.drawLine(100, 200, 200, 210, pen);
canvas.drawLine(100, 200, 200, 220, pen);
canvas.drawLine(100, 200, 200, 230, pen);
}
}
And using MyControl class this way:
public class prova extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
MyControl ctrl = new MyControl(this);
setContentView(ctrl);
}
}
Setting StrokeWidth to 0 or > 1 all lines are plotted.
Can anyone bring some light on this or should I submit this issue at
http://code.google.com/p/android/issues/list ?
Thanks in advance!
Best Regards,
NarcĂs Calvet
Steema Software
http://www.steema.com
http://twitter.com/SteemaSoftware
https://www.facebook.com/SteemaSoftware
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en