Canvas' drawLine and drawRect not including end position?

后端 未结 4 1062
无人共我
无人共我 2021-02-13 03:20

To my surprise I\'ve just discovered that drawLine and drawRect don\'t include the ending position, i.e.:

canvas.drawLine(100, 100, 100, 100, paint);
4条回答
  •  伪装坚强ぢ
    2021-02-13 03:33

    if your background is black ,add one statement paint.setColor(Color.RED); and also you had pass RectF rect = new RectF(100, 100, 100, 100); all points are same , try RectF rect = new RectF(100, 100, 200, 200);

    OR for line canvas.drawLine(10, 10, 10, 10 + 15, paint);

提交回复
热议问题