Bug in Canvas.drawVertices? (with repro code and logcat)

后端 未结 1 1763
盖世英雄少女心
盖世英雄少女心 2021-01-24 21:35

Simply paste this code into a simple skeleton Android project.

public final class DrawableView extends View
{
    private float[] mVertices = {0, 0, 255, 0, 255,         


        
相关标签:
1条回答
  • 2021-01-24 22:11

    Even though the documentation for drawVertices does not spell this out explicitly, the array size of the verts, texs, and colors arrays must all match the vertexCount. The third answer down in this question would also seem to confirm this. Keep in mind, only the first (vertexCount / 2) colors are used to draw the triangles, the other values are ignored.

    0 讨论(0)
提交回复
热议问题